Forum

How to calculate an Angle from a Cos?

I have a formula to calculate the location off an unknown point with Trigonometry. (2 other values come from a distance sensor)

For this formula, I need to have an Angle.

I have this now: Cos A = 0.6819

If I enter this in my calculator (shift cos) I get ~47 degrees, and that is correct.

How do I do this in vvvv with the Expr (val) node?? So I can finish my calculation, and generate the X,Y posistion off the unknwn object.

I attacthed the first part off my calculation, hope some one can help, trying to figure this out for some time now…

inverted Cos.v4p (5.8 kB)

you have to use arccos, the inverse consine function. it gives you radians (0…2Pi rad ^= 0…360 degree), which is the mathematical measure for angles. divide the radians by 2Pi to normalize it (then you have the vvvv angle measure 0…1), then multiply by 360 to get degree…

inverted Cos.v4p (5.8 kB)

Wow, I think I let this project rest :(

Already having a hard time understanding some off the basics off normall angels (cartesian coordinates??) and now with the radians…

This is one off these days I realize I should have paid more attentions in Math Class.

Thnx for the explanation Tonfilm!!

not long ago there was a thread about angles here.
gregsn posted some modules dealing with angle conversion.
unfortunately he attached them to the forum instead of using the wiki.
well, vvvvdevs seem to be pretty busy.

it is here:

link

sorry, i know, i will try to do more wiki pages next time.

note that if you deeply understood Point2Vector, Vector2Point and the power of the phase input of the CircularSpread, you can avoid almost always dealing with sines, cosines, arctans, and the like.

similarly Map is made for never ever thinking again about rules of proportions (rule of three) and doing things like converting from rad to grad to angles to whatever always cleanly with just one node. So i not really recommend focussing on gregsns little modules. basically you can always invent the solution on the spot with very little clicks after you know some basics.

right.

and most of the time you even don’t need the map nodes, cause all rotations are measured in fractions of full cycles. however the expr e.g. does ist otherwise. and entering 2*pi into the map-node can be pain.

so, that’s the most important thing: you always should be aware of the value range of your data. then you should be able to do the convertion on your own.

which reminds me of my old wishist item of being able to input math expressions in IOBoxes (Value) which get evaluated once when enter is pressed. or constants like pi

Thanx for the great Wiki Gregsn, specialy for the Conversions section :)

Still having trouble with the distance sensors, but that is just me ;)

Now I have the tools to crack it!!

also, thank you for explaining the ‘cyclic’ option on the filter nodes, although that was not your primary concern :)

welcome! it was actually fun to do it. Rotation Angles for 3D Animations will be a bigger topic, i guess…