treddie
Computer
- Dec 17, 2005
- 417
In ProE/Creo, for some reason I cannot fathom, PTC breaks from mathematics tradition by using degrees instead of radians in its calculations. This may be fine for simple functions, such as Sin(THETA), but completely fails for more complicated functions such as:
Cos(THETA) + THETA * Sin(THETA).
Because of this, the following will not work in a Curve From Equation scenario in ProE:
Code:
rb = .45333
ro = .53928
/* "t" is ProE's internal counter variable (analogous to "trajpar"), and counts from 0 to 1.
/* This equation is naturally with respect to radians, so the last term in parens converts from rads to degs:
THETAstop = ((Sqrt(ro - rb) * Sqrt(rb + ro)) / rb) * (180/pi)
/* Now comes the "fun" part, where ProE's insistence on using degrees causes failure:
x = rb * (Cos( t * THETAstop ) + ( t * THETAstop ) * Sin( t * THETAstop ))
x = rb * ( Sin(t * THETAstop ) - ( t * THETAstop ) * Cos( t * THETAstop ))
The last two equations are what they are and must be calculated with respect to radians, NOT degrees. So what is the solution to this conundrum?