Angles from a sine

Discuss programming in the QuakeC language.
Post Reply
Nahuel
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Angles from a sine

Post by Nahuel »

hello quake community! I need to know which function can give me the angle from a sine (arcsine function :) ) in qc. I'm using Darkplaces engine and fteqcc (maybe the engine has a function for this). thanks in advance.
hi, I am nahuel, I love quake and qc.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Angles from a sine

Post by Spike »

quoting dpextensions.qc:
float(float s) asin = #471; // returns angle in radians for a given sin() value, the result is in the range -PI*0.5 to PI*0.5

you'll need to rescale it to degrees if you want to use it for an entity angle.
Nahuel
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: Angles from a sine

Post by Nahuel »

Spike wrote:quoting dpextensions.qc:
float(float s) asin = #471; // returns angle in radians for a given sin() value, the result is in the range -PI*0.5 to PI*0.5

you'll need to rescale it to degrees if you want to use it for an entity angle.
thank you spike, finally i used a scale by the distances with the sine, because the real angle (in degrees) was too exagerated :)
hi, I am nahuel, I love quake and qc.
Post Reply