MCPcopy Create free account
hub / github.com/CruiserOne/Astrolog / Midpoint2

Function Midpoint2

general.cpp:547–563  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

545// Like Midpoint() but return the point proportioned between the two degrees.
546
547real Midpoint2(real deg1, real deg2, real rRatio)
548{
549 real mid;
550
551 if (rRatio == 0.5) {
552 // Simple bisection is the same as Midpoint() function.
553 mid = (deg1 + deg2)/2.0;
554 if (MinDistance(deg1, mid) >= rDegQuad)
555 mid = Mod(mid + rDegHalf);
556 } else {
557 // Alternate ratio requires different math.
558 mid = Ratio(deg1, deg2, rRatio);
559 if (RAbs(deg2 - deg1) > rDegHalf)
560 mid = Mod(mid + ((deg1 > deg2) ? rDegMax : -rDegMax)*rRatio);
561 }
562 return mid;
563}
564
565
566// Return the minimum great circle distance between two sets of spherical

Callers 6

FEvalFunctionFunction · 0.85
ChartMidpointRelationFunction · 0.85
CastRelationFunction · 0.85
FCreateGridFunction · 0.85
FCreateGridRelationFunction · 0.85
ChartMidpointFunction · 0.85

Calls 2

MinDistanceFunction · 0.85
ModFunction · 0.85

Tested by

no test coverage detected