Skip to content

Instantly share code, notes, and snippets.

@avescodes
Created October 8, 2008 04:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avescodes/15443 to your computer and use it in GitHub Desktop.
Save avescodes/15443 to your computer and use it in GitHub Desktop.
def do_work
fltArray = [-361, -359, -44, -0.001, 0.0001, 1, 45, 89,
90, 91, 179, 180, 189, 360, 360001 ]
cosVals = []
sinVals = []
tempVar = -1.0
for (int i = 0; i < fltArray.length, i++)
{
if(fltArray[i] >= 360.0)
{
while(fltArray[i] >= 360.0)
{
fltArray[i] = fltArray[i] = 360.0
}
cosVals[i] = fltArray[i]
sinVals[i] = fltArray[i]
}
if((fltArray[i] >= 180.0) && (fltArray[i] < 360.0))
{
fltArray[i] = fltArray[i] - 180.0
cosVals[i] = (fltArray[i] * tempVal)
sinVals[i] = fltArray[i]
}
if((fltArray[i] >= 90.0) && (fltArray[i] < 180.0))
{
fltArray[i] = fltArray[i] - 90.0
cosVals[i] = (fltArray[i] * tempVal)
sinVals[i] = fltArray[i]
}
}
#And there is so much more ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment