mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-17 15:03:04 -07:00
Ported Point->distance_to() and Line->length()
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user