Hello, I need some simple math functions for moving a Surface with a input like this: (float way, float angle) I could not find any other math functions besides the AgateLib.DisplayLib.Origin functions. |
|||
|
|
|
AgateLibAwesome Game and Tool Engine Library |
|
|
|
Oh did not know that there
Oh did not know that there was such a function for norm, that is good.
Yes, the distance should be computed like this: Norm(a-b), looked it up wrong.
Well about the alpha function, you have two points which describe a triangle and alpha is on a.
So you get the distance and hight between a and b. Then you can compute the angle alpha.
Yes, I know this problem but forgot to add a check for it, was late yesterday and I learned vector math in half a hour.
Thanks for adding the two functions and yes this is what I was trying to get.
Hello, I wrote three methods
Hello,
I wrote three methods for the Vector2 struct:
I hope the math is correct....
There already is the function
There already is the function Vector2.Magnitude, which does the same thing as Norm except it is not static. Should your distance function be Norm(a - b)? What is the Alpha function doing? There is a bit of a problem, for example if b = (0,2) and a = (1,0), then it will take Asin(2) which is undefined.
I have added a static method which computes the distance between two vectors through this method. I also added one to calculate the angle between two vectors. I hope that is what you are trying to get at here.
There is not a general
There is not a general purpose class of math functions, analogous to System.Math in AgateLib. I've run into deficiencies in System.Math before but at the moment I can't remember what they were aside from the lack of a struct for complex numbers. What do you mean it doesn't have a function for a radical? Something like Math.Pow(x,1.0/y) gives the y-th root of x.
So that function you're talking about, it's something like
I can add something like this, probably as a static member in PointF and Vector2. Also if you give me a list of math functions that you would find useful I will work on coding them up and adding them to AgateLib. (or if you want to contribute code, that's welcome too :)
Yes, I mean this: ?4 = 2 or
Yes, I mean this: ?4 = 2 or ?81 = 3
Math.Pow(x,0.5) should work :)
Yes, this function.
Currently I don't need more math functions. Maybe later.
Edit: Seems this wiki does not like the square root char, it displays ?.