asin and acos

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
User avatar
turshija
Posts: 127
Joined: Sat Feb 17, 2007 9:26 am
Location: Novi Sad, Serbia
Contact:

asin and acos

Post by turshija »

Wierd arcsin and arccos are not yet implemented ... :shock:

any trig function to get arcsin and arccos without it?
i need it for my new project ...
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

you have atan2: you have what you need ;)
http://en.wikipedia.org/wiki/Inverse_tr ... alculation

read also the "Two argument variant of arctangent" snip.

However, a preprocessor feature would be GREAT!
Something like the ansi-C DEFINE would help ;)
User avatar
turshija
Posts: 127
Joined: Sat Feb 17, 2007 9:26 am
Location: Novi Sad, Serbia
Contact:

Post by turshija »

okay ...
i looked at that site, and im obviously too stupid :)
can you just write me what should I type to find asin and what to find acos in ZGE ? :)
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

maybe tomorrow i'll post! In the meantime, tell me what you would like to do...
User avatar
turshija
Posts: 127
Joined: Sat Feb 17, 2007 9:26 am
Location: Novi Sad, Serbia
Contact:

Post by turshija »

i want to make game with third person camera so basically I want something like this:
Image

red circle in the middle is PlayerModel and α is the PlayerModel's rotation ...
I want to place camera behind the player and to follow him by setting the camera's position to M position with α rotation ...
but I don't know how to find M(x,y) ... I think it can be found like this:

Code: Select all

x = arccos(alfa+pi);
y = arcsin(alfa+pi);
but I'm not really sure, and I can't try it at all since I don't have arccos and arcsin functions :)
Post Reply