Forum

Angles from a sine

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Angles from a sine

Postby Nahuel » Tue Aug 14, 2012 3:46 pm

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.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: Angles from a sine

Postby Spike » Tue Aug 14, 2012 7:13 pm

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.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Angles from a sine

Postby Nahuel » Wed Aug 15, 2012 10:28 am

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.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest