Tutorial Mathematics - Basic Uses and Application

Reaction score
86
XD, Woops, I'll put an arc in there as soon as I finished this test. Also, I'm assuming this function returns phi?
 

Trollvottel

never aging title
Reaction score
262
yes it does, but in degrees, not in radians as you see. Maybe you should make a little functions collection with much used things like PolarX/Y/Z in 3D and 2D and angle between points such as distance between points and so on so readers can see how the functions would look like. ( i think you did this for jass users, since the most things you explained are premade in GUI )
 
Reaction score
86
So you mean make the functions and then put them in the tutorial and explain them?

Also, about the function, I was testing it and some things that are annoying. I put in 10 as an angle for phi, returns 80. ?... Also, point 1 was the source, and point 2 was the spherical coordinate

80 returns 10
 

Trollvottel

never aging title
Reaction score
262
oh yeah. i think what i did wrong is


local real x = x1 - x0
local real y = y1 - y0
local real z = z1 - z0


which should be


local real x = x0 - x1
local real y = y0 - y1
local real z = z0 - z1
 

martix

There is no spoon
Reaction score
49
Hows about adding a piece about Cartesian<->Polar transformations? :)
Put some nice examples and appications. When you think about it, these are the most powerful, yet underused functions. Probably because of the lack of knowledge and imagination in your average map maker.
And with the trig(aslo the arc/inverse) functions you can achieve simply amazing things.
 
Reaction score
86
Cartesian to Polar transformations? So, to put it simply, converting between polar co-ordinates and Cartesian coordinates... But what else do you mean by that? Sorry if my question seems stupid. Haven't been to school in 2 months ;D
 

martix

There is no spoon
Reaction score
49
Well it would be useful for people to know how to convert between polar coordinates(distance, angle) and Cartesian ones(abscissa - X, ordinate - Y). Thats what I meant. I thought you were familiar with the terms because of your pick of tutorial subject.
Otherwise its a great tutorial for the basic stuff.
I guess the really great stuff is from beyond school(analytical geometry and the like).
 
Reaction score
86
I know of the terms Cartesian coordinate system, and know enough about Polar Coordinates. Was just unsure about what you wanted me to add about them. I already have a section about using Polar Coordinates, so I guess I could put a quick section on converting back...

Updated: I understand what you meant but check to make sure xD...
 

GoGo-Boy

You can change this now in User CP
Reaction score
40
Interesting. Haven't seen it because I haven't been here for some time... good bumb :thup:

I'm very much interested in all mathematics because you can do so nice movements and all with it -> extreme cool looking spells.

Most of that I already know now but perhaps the last part might help a bit with my try to rotate something in 3D correctly.
+Rep although I can't give it, because you already helped me with some geometry today^^
 
Reaction score
86
An easy way to rotate something in 3D, is to find the 3D Distance, get the 3D angle (Z Angle) and the regular angle, and then just us the 3D spherical projection to the Z Angle+180 and the Regular Angle + 180. In this case, it will rotate to the opposite side.
 

GoGo-Boy

You can change this now in User CP
Reaction score
40
Didn't try you way yet, but maybe you could help and tell me why the following does not work?

For the radians 0 / 0.5pi / 1pi / 1.5 pi I get a somewhat perfect rotation. But there closer I come to 0.25pi / 0.75pi / 1.75 pi the less the x/y rotation works. While the height is still correct the units barely move sideways. That means that the way I calculate the correct x/y position is wrong, or at least parts of it... might you tell me how to do it correctly, but keep the way I chose?^^


JASS:
if f.time &lt;= 300 * f.max_time then    
    call SetUnitFlyHeight(f.ice, FLY_HEIGHT + DISTANCE + DISTANCE * Sin( bj_PI * 2 * f.time),0)
    call SetUnitFlyHeight(f.fire, FLY_HEIGHT + DISTANCE + DISTANCE * Sin( bj_PI +  bj_PI * 2 * f.time),0)
    
    call SetUnitX(f.ice,f.caster_x + (DISTANCE * Sin(PI_HALF + bj_PI * 2 * f.time)) * Sin(f.facing))
    call SetUnitY(f.ice,f.caster_y + (DISTANCE * Sin(PI_HALF + bj_PI * 2 * f.time)) * Cos(f.facing))
            
    call SetUnitX(f.fire,f.caster_x + (DISTANCE * Sin(bj_PI + PI_HALF+ bj_PI * 2 * f.time)) * Sin(f.facing))
    call SetUnitY(f.fire,f.caster_y + (DISTANCE * Sin(bj_PI + PI_HALF+ bj_PI * 2 * f.time)) * Cos(f.facing))
            
set f.time = f.time + SLIDE_PERIOD
else
 

Caedin88

New Member
Reaction score
1
Most of this stuff is already available in the GUI. Such as Math - distance between points, and Math - angle between points. The Z angle stuff is kinda useful though, Although I don't know when I would ever use it.
 
Reaction score
86
Yea, Caedin88, a lot of this stuff is under the math section as stated inside the tutorial itself, but, the fact of the matter is a lot of people don't know how to use it correctly, so its important to show people how it can be used. Thanks, I learned the 3D stuff as I was writing the tutorial so I thought I'd just add it :D. The 3D stuff can actually be pretty useful. I was making an attachment to the Attack Ground command, and, wherever it hit, it would send the units in the area flying through the air in a sort of leap. This required some 3D calculations, or, basically, a parabola that was mapped on the X+Y,Z plane. (instead of it being X,Y it's X+Y because it just determines the Direction of the parabola while Z determines the height or the "Y" of it.)

Besides that, bump!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top