mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-09 14:55:08 -06:00
Ported Point->distance_to() and Line->length()
This commit is contained in:
parent
c9f68ed28a
commit
e19c6a1494
7 changed files with 18 additions and 6 deletions
|
@ -64,6 +64,14 @@ Point::nearest_point(Points points) const
|
|||
return &(points.at(this->nearest_point_index(points)));
|
||||
}
|
||||
|
||||
double
|
||||
Point::distance_to(const Point* point) const
|
||||
{
|
||||
double dx = ((double)point->x - this->x);
|
||||
double dy = ((double)point->y - this->y);
|
||||
return sqrt(dx*dx + dy*dy);
|
||||
}
|
||||
|
||||
SV*
|
||||
Point::to_SV_pureperl() {
|
||||
AV* av = newAV();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue