FAQ  •  Register  •  Login

Angles from a sine

Moderator: Inside3D Admins

<<

Nahuel

User avatar

Posts: 367

Joined: Wed Jan 12, 2011 8:42 pm

Location: mar del plata

Post Tue Aug 14, 2012 3:46 pm

Angles from a sine

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: 2063

Joined: Fri Nov 05, 2004 3:12 am

Location: UK

Post Tue Aug 14, 2012 7:13 pm

Re: Angles from a sine

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

User avatar

Posts: 367

Joined: Wed Jan 12, 2011 8:42 pm

Location: mar del plata

Post Wed Aug 15, 2012 10:28 am

Re: Angles from a sine

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.

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.
Icons provided by Aha Soft