Skip to content

Commit

Permalink
CircularArc: Add comment from @rouault on optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaston committed Aug 16, 2024
1 parent c354044 commit b4aa3df
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/geos/geom/CircularArc.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ class GEOS_DLL CircularArc {
return 2*MATH_PI;
}

/// Even Rouault:
/// potential optimization?: using crossproduct(p0 - center, p2 - center) = radius * radius * sin(angle)
/// could yield the result by just doing a single asin(), instead of 2 atan2()
/// actually one should also likely compute dotproduct(p0 - center, p2 - center) = radius * radius * cos(angle),
/// and thus angle = atan2(crossproduct(p0 - center, p2 - center) , dotproduct(p0 - center, p2 - center) )
auto t0 = theta0();
auto t2 = theta2();

Expand Down

0 comments on commit b4aa3df

Please sign in to comment.