No.11963806 ViewReplyOriginalReport
The solution to this seemingly simple algorithm eludes me.
I'm trying to model organic shapes with a sin curve in openScad

Given the starting and ending angles, find the maximum and minimum values of the sin curve. Assume aStart<aEnd and peak=1

Simple enough if they're in the same quadrant or the span is 360 or greater, but I cant figure out a way to determine if the curves pass through 90 or 270 degrees

My best feeble attempt is something like:
function passesThrough90(aStart,aEnd) = ((aStart<=90 && aEnd>=90) || (aEnd-aStart)>=360));
Which fails with aStart = 91 and aEnd = 360+90

help with this would be greatly appriciated