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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top