Gamestudio Links
Zorro Links
Newest Posts
Zorro version 3.0 prerelease!
by Grant. 02/24/26 22:21
WFO Training with parallel cores Zorro64
by Martin_HH. 02/24/26 19:51
ZorroGPT
by TipmyPip. 02/23/26 21:52
Camera always moves upwards?
by clonman. 02/21/26 09:29
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
5 registered members (TipmyPip, clint000, Grant, chsmac85, Martin_HH), 5,858 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Trigonometry #77613
06/13/06 19:14
06/13/06 19:14
Joined: Apr 2006
Posts: 265
V
vartan_s Offline OP
Member
vartan_s  Offline OP
Member
V

Joined: Apr 2006
Posts: 265
I'm having a little problem with my trigonometry. I can use it to find lengths, but how do I give it as a reciprocal so I can work out angles? I already searched the site for this.

Re: Trigonometry [Re: vartan_s] #77614
06/13/06 19:22
06/13/06 19:22
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
You mean you have the length of two sides of a triangle and now you want a certain angle in this triangle? (where one has 90°)

Please explain your problem more precisly.

Re: Trigonometry [Re: Xarthor] #77615
06/13/06 20:21
06/13/06 20:21
Joined: May 2005
Posts: 83
Texas
mocosgames Offline
Junior Member
mocosgames  Offline
Junior Member

Joined: May 2005
Posts: 83
Texas
You would use atan or asin or acos

for example fatan(adjacent,opposite) would give you tha angle of x in a right triangle

Re: Trigonometry [Re: Xarthor] #77616
06/14/06 18:43
06/14/06 18:43
Joined: Apr 2006
Posts: 265
V
vartan_s Offline OP
Member
vartan_s  Offline OP
Member
V

Joined: Apr 2006
Posts: 265
Quote:

You mean you have the length of two sides of a triangle and now you want a certain angle in this triangle? (where one has 90°)

Please explain your problem more precisly.




Yes that's the problem. So do I use fatan or atan? Or is it different?

Re: Trigonometry [Re: vartan_s] #77617
06/14/06 19:47
06/14/06 19:47
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline
Senior Expert
ulillillia  Offline
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
Quote:

I'm having a little problem with my trigonometry. I can use it to find lengths, but how do I give it as a reciprocal so I can work out angles? I already searched the site for this.




For a reciprocal, just raise a value to a negative exponent:

some_var = pow(some_angle, -1);
another_var = pow(some_angle, -0.5);

The top one takes the reciprocal of the variable, some_angle and the bottom one takes the square root of some_angle then gives the reciprocal. If some_angle was 4, you'd get 0.25 in the top one and 0.5 in the bottom one. I don't know if this is what you're after.


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Re: Trigonometry [Re: ulillillia] #77618
06/15/06 13:50
06/15/06 13:50
Joined: Apr 2006
Posts: 265
V
vartan_s Offline OP
Member
vartan_s  Offline OP
Member
V

Joined: Apr 2006
Posts: 265
Nope. Unfortunately not it. I don't think I've explained well. Say you have an angle x, which you want to find out, and you have the adjacent and opposite sides. Usually you would get the reciprocal of tan and put the opposite side/adjacent side to work out x.

I'm asking how you could work this out in gameplay, with functions.

Re: Trigonometry [Re: vartan_s] #77619
06/15/06 14:01
06/15/06 14:01
Joined: Sep 2003
Posts: 4,959
US
G
Grimber Offline
Expert
Grimber  Offline
Expert
G

Joined: Sep 2003
Posts: 4,959
US
angle = atan(opposite/adjacent);


Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1