Maths Expression Pow

noonanon's picture

Is there a way of writing pow in the maths expression patch? I thought it was written pow(x,2) in javascript but this doesnt work for me

this is the math I am trying to convert - http://local.wasp.uwa.edu.au/~pbourke/geometry/diamond/

cos(t) * sqrt(pow2(cos(t)))

Any ideas where I am going wrong

cwright's picture
Re: Maths Expression Pow

Are you using Math Expression, or Javascript?

In JS, you need to use the Math object (Math.cos(), Math.sin(), Math.pow(), etc).

In Math Expression, you use the ^ operator (3^3 = 27)

noonanon's picture
Re: Maths Expression Pow

math expresssion patch

ok I see now, thanks for clearing that up

cybero's picture
Re: Maths Expression Pow

Math Expression wouldn't something like

sin(t) * sqrt(sin(t*t)) 

or

cos(t) * sqrt(cos(t*t))

work?

cwright's picture
Re: Maths Expression Pow

I'm thinking cos(t)^2 wouldn't be the same as cos(t^2), but I may have let my trig identities rot over the past decade... ;)

cybero's picture
Re: Maths Expression Pow

Succinct :-).