Silly people call it arctangent. Same thing.
Wouldn't arctan/atan/arcustangent or some similar function exist, with one argument? And then atan(y/x). As that is only what atan2 does.
EDIT: I am a bit slow on the refresh button, it seems.
Silly people call it arctangent. Same thing.
Wouldn't arctan/atan/arcustangent or some similar function exist, with one argument? And then atan(y/x). As that is only what atan2 does.
EDIT: I am a bit slow on the refresh button, it seems.
At first I also thought that atan2 and atan(y/x) was the same thing, but apparently it isn't. Not according to the definition I found. And I just tested it a minute ago and it works great.
Thanks for trying to help me though. I appreciate it.
I still don't see much difference. You just don't divide with zero, and check for the correct sign. Also note that atan2 is capable of returning angles on a larger interval. That might be useful if you do not stick to the strict mathematical definition.
The atan2() and the atan2f() functions compute the principal value of the arc tangent of y/x, using the signs of both arguments to determine the quadrant of the return value.
That's the difference...
Not really.
atan2 ...returns an angle in the range from -PI to PI expressed in radians...
atan ...returns an angle in the range from -PI/2 to PI/2 expressed in radians...
U C?
I'm really not sure how to respond.
This is from the PHP online manual:
There is a difference between the two functions but I really can't go in-depth and explain anything. I don't have the necessary skills.This function calculates the arc tangent of the two variables x and y. It is similar to calculating the arc tangent of y / x, except that the signs of both arguments are used to determine the quadrant of the result.
The function returns the result in radians, which is between -PI and PI (inclusive).
Okie. Arc tangent(x), as in the classic, mathemathical function, defined as the number between -PI/2 and PI/2, whose tangent equals x. So, basically the inverse function of tangent(x).
You'd see now that tan(atan(x) ) would be x, if -PI/2<x<+PI/2. So, you're not going into the second and third quadrants, ever. So if you'd take tan(atan(3/2 PI) ) you'd get -PI/2, not quite what you'd expect. atan2 is extended so you can do this conversion back and forth with any angle from 0 to 2PI radians.
Ah I see. Thanks for explaining.
Anyway, as usual, when porting, some unexpected things are happening. Need to find the source of these evil doings!
What are you porting from and to? I'm just curious.
I made the IK arm in a language called Jamascript, used by a program called Jamagic. It's based on Javascript. I'm porting the code to Multimedia Fusion, which really isn't a language at all. But I guess you know about it...
I would've done it in C if I knew anything about graphics programming. But I haven't got that fair yet. Still doing simple console apps.
ActionScript is good, if you know a bit of Flash. You don't have to mess with graphics, and it's very similar to C++, although obviously a lot more basic. Did an adventure game sortof thingy in it. Never got finished... well, not yet.
Not very good with Flash either. Though ActionScript is pretty easy to understand. I might give it a try. Though I'd really want to learn to create everything from scratch sometime.
If "everything from scratch" means truly everything, well, that's a nice thing, but pretty dangerous in some ways. What I mean is that being a top-class low-level coder means you'll be able to ace most programs in terms of speed, but it also means your knowledge will be very limited, chained to a specific hardware/OS combination. Like how VGA graphics in DOS was insanely simple, but in OpenGL, even that became a bit problematic. Freaking slow, too, but at least it worked in WinXP.
But, you could always just lucky and guess who'll come out as a victor from the next-gen console war, and master that architechture.
Hah, yeah that is the best course of action. I have to say, I actually enjoy programming hardware where the actual system is already done and all you have to do is read and write to some registers. That's why I really love GBA programming. I just need to get the hang of some common C stuff like structures and different kind of pointers. But apart from that, it's piece of cake.
Right now I'm porting my IK exampel to GBA. I've already set up the graphics. Just need to port the code now.
Nah, I dislike counting clock cycles and comparing the speeds of register access. Also, the concepts of AI and assembler don't really like go well together. I also found it a bit troublesome (back when I tried my hand at VGA under DOS) that if you want to do something that's not supported on the hardware level, you'll have to optimize it real hard. Scrolling was a pain, I imagine I probably wouldn't have been able to get some unfilled polygons to display in 3D there at decent speeds. And the last thing I'd want to do is optimize mathemathical routines in assembler.
To each his own, I guess.
I hope your stuff will work in VBAdvance.