What's new

Equation problems

ftkalcevic

Member
I'm trying to implement the equation to approximate the perimeter of an ellipse.

I'm basing it on "Approximation 3" here...
https://www.mathsisfun.com/geometry/ell ... meter.html

h = (a-b)^2 / (a+b)^2
p = pi(a+b)(1 + 3h/( 10 + sqrt(4-3h)))

But I can't seem to make any progress because of the strict typing.

My constants A and B are distances, derived from other parameters.

I'm stuck at trying to create a variable called H, using the equation above. Squaring (a-b) fails immediately because they are distances. I've tried setting the type of H to scale and distance, but no success.

Any suggestions? Can I convert (cast) a distance to scale type?
 
ftkalcevic,

I am glad that my post helped you out. The strength of the type definitions coupled with the lack of casting operators can be quite a challenge.

Please, go to the User Control Panel and fill in some "blanks" there. Where you are from, what is your general description, and the like.
 
Top