MCPcopy Create free account
hub / github.com/Geode-solutions/OpenGeode / point_disk_distance

Function point_disk_distance

src/geode/geometry/distance.cpp:1422–1437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1420 }
1421
1422 std::tuple< double, Point3D > point_disk_distance(
1423 const Point3D& point, const Disk& disk )
1424 {
1425 const Vector3D center_to_point{ disk.plane().origin(), point };
1426 const auto distance_to_plane =
1427 center_to_point.dot( disk.plane().normal() );
1428 const auto projected_on_plane =
1429 point - disk.plane().normal() * distance_to_plane;
1430 if( point_point_distance( disk.plane().origin(), projected_on_plane )
1431 <= disk.radius() )
1432 {
1433 return std::make_tuple(
1434 std::fabs( distance_to_plane ), projected_on_plane );
1435 }
1436 return point_circle_distance( point, disk );
1437 }
1438
1439 template < index_t dimension >
1440 double Bisector( const geode::index_t number_of_components,

Callers 1

Calls 6

point_point_distanceFunction · 0.85
point_circle_distanceFunction · 0.85
dotMethod · 0.80
planeMethod · 0.45
normalMethod · 0.45
radiusMethod · 0.45

Tested by 1