problem with calculations

uberfoop

~=Admiral Stukov=~
Reaction score
176
ok-i was trying to make a jump ability, and to calculate the distance, i used x-x and y-y to find the straight edges of a triangle, then used pythagorean theorum to find the hypotenuse (a squared+b squared=c squared, or basically the distance is "square root of: a squared+b squared" a and b being the non-hypotenuse sides. just if u didnt know this yet. which you all probably did.).
ANYWAY, it worked fine most of the time, but game me a waaaay shorter distance when i cast the spell downward. the points couldnt have been off, i once tryed putting lightning effects down to see if the points were setting in the right places, and they were.

so is there somethig wrong with the square root function? should i use tangent and arctangent?
 
well if your jump is supposed to work the way I think it works, your jump overall would follow the path of an isosceles triangle. And you would be splitting that triangle up into two right-angled triangles. Like so:


Code:
     b    
    /|\
   / | \                       unit is jumping from a to b to c
  /  |  \
 a---d---c

The line down the middle splits the triangle into two right-angled triangles.

So, let's work through it:

a = unit's current position

c = the point where the unit ends up. I think the editor has a function to grab the distance to the target point from the current unit position, but if it doesn't we can do it manually.

d = half that distance

b = the distance above d that the unit is supposed to jump up to (you decide what that is)

so to calculate how far the unit moves from a to b, you do:

amount to move = sqrt ( b-squared + d-squared)

and the amount the unit moves from b to c is the same.

now I'm not 100% sure what you are doing, but I hope that helps.
 
what you described to me looks like this
{code} a=bsquared=abc=jump=rock=triangleforsomereason=jumplongevity=omfgmyheadblewup=a{code/}

then the third post look like this to me

{code} /\
/ \
/ \= Cheap crack=wtfydidyoujumpthathigh=holycrapyoushouldhavedied=whatwereyousmoking=watdoestriangleevenhavetodowiththis,itsallaboutcrack=marajuana=a {code/}

its all pretty confusing as you can see(lol) could someone explain to me how to make blink into a jump in the first place? it seems very hard to do. do you need JASS? :eek: :eek: :eek:
 
OK, a little help to understand what you are doing. You cast an ability and the point you cast it on becomes x1, y1? Your unit's current position is x0, y0? You are using the formula sqrt((x1-x0)^2+(y1-y0)^2) to calculate your jump distance?

You cast DOWN (South) and it doesn't work?

Maybe post the trigger code...

ThySpektre


uberfoop said:
ok-i was trying to make a jump ability, and to calculate the distance, i used x-x and y-y to find the straight edges of a triangle, then used pythagorean theorum to find the hypotenuse (a squared+b squared=c squared, or basically the distance is "square root of: a squared+b squared" a and b being the non-hypotenuse sides. just if u didnt know this yet. which you all probably did.).
ANYWAY, it worked fine most of the time, but game me a waaaay shorter distance when i cast the spell downward. the points couldnt have been off, i once tryed putting lightning effects down to see if the points were setting in the right places, and they were.

so is there somethig wrong with the square root function? should i use tangent and arctangent?
 
Can you measure how much shorter a distance it gave you when casting it due south?
 
MooMooMan said:
what you described to me looks like this
{code} a=bsquared=abc=jump=rock=triangleforsomereason=jumplongevity=omfgmyheadblewup=a{code/}

then the third post look like this to me

{code} /\
/ \
/ \= Cheap crack=wtfydidyoujumpthathigh=holycrapyoushouldhavedied=whatwereyousmoking=watdoestriangleevenhavetodowiththis,itsallaboutcrack=marajuana=a {code/}

its all pretty confusing as you can see(lol) could someone explain to me how to make blink into a jump in the first place? it seems very hard to do. do you need JASS? :eek: :eek: :eek:

Sigh... You would have to know at least a tiny bit of algebra. These are formulas for finding the distance between points, and the length of the third side of the triangle.
Wouldn't warcraft use an arc, not a triangle. That might change it a bit, and you could just use the formula for circumfrance to find that distance.
(C=2<Pi>R)
 
meh, ill check the distance of the virticle side. if it seems right ill just use trigonometry...
 
:cool:
MooMooMan said:
what you described to me looks like this
{code} a=bsquared=abc=jump=rock=triangleforsomereason=jumplongevity=omfgmyheadblewup=a{code/}

then the third post look like this to me

{code} /\
/ \
/ \= Cheap crack=wtfydidyoujumpthathigh=holycrapyoushouldhavedied=whatwereyousmoking=watdoestriangleevenhavetodowiththis,itsallaboutcrack=marajuana=a {code/}

its all pretty confusing as you can see(lol) could someone explain to me how to make blink into a jump in the first place? it seems very hard to do. do you need JASS? :eek: :eek: :eek:

nono, i think it makes sense, unless for some reason the editor dosent have that function, which im sure it does if you play around with it...

actually, thats how i learned 99% of the stuff i know now...
 
Using a triangle is likely your simplest approach. If you really wanted to, you could find the actual length of the parabolic trajectory of the jumping unit using the arclength equation.

L = Integral of ((dy/dt)^2+(dx/dt)^2)^1/2, evaluated across a distance a to b.
dy/dt = derivative of (ƒ(t) = s + vt + 1/2at^2), s = initial height, v = velocity in upward (y) direction, a = downward acceleration, and t = time.
dx/dt = derivative of (ƒ(t) = s + vt + 1/2at^2), s = initial position, v = velocity in sideways (x) direction, a = sideways acceleration (should be 0), and t = time.
Motion would be thought of along a plane in the xyz space, which would yield a nice 2-D cartesian coordinate system, using y as height and x as sideways distance.

But, that would take some Riemann sums and such, or perhaps some JASS, as there are no integral functions in the World Editor if my memory serves me right. Triangles would work better, as they would be MUCH easier.

So now that the best trajectory is cleared up, for your problem...ideas would come to mind past the one you are checking, but I must inquire--jumping downward--is that jumping South? Or off a cliff or something, using some crazy JASS stuff? I would have to say that your looking at the vertical leg is on the right track. As for the square root function, your idea should work just fine as the square root just calculates a square root, nothing more. More than likely, there is something wrong with one of the inputs, not your calculations, so don't be so hasty to change to using trigonometry.
 
hey cool how did you do the curvy f's in f(t) ?

as another suggestion, if he really wants it to be curved and not straight, maybe he can use an inverse parabolic equation?

equation of a parabola: y = ax^2 + bx + c
for simplicity lets say its: y = ax^2 + b

inverse parabola: y = -ax^2 + b

food for thought....
 
Darg said:
hey cool how did you do the curvy f's in f(t) ?

Option-F for me. Maybe alt-F for Windows?
 
No, Alt-F opens the File menu. Alt is mainly used for menu shortcuts.

EDIT: You can always copy and paste the ƒ's from Sargon's post. :D
 
Well, this is sort of off-topic...but due to popular demand, and even an administrator asking, I'll post. Curvy f's are created using the alt+xxx keys. If you are using Windows, there is a character mapping program hidden deep on your start menu that tells you the alt+xxx entry for that letter. Depending on the font, many of these symbols might be mapped differently. The default text on here is Times New Roman, if I'm not mistaken, so you would want to look at the alt+xxx entry for Times New Roman. Or, change your text if you want to to see a different character mapping. Most mappings are similar, although some are completely different for certain characters. For instance, a certain function in Warcraft II allowed you to print a file folder character onto the screen with the default Battle.net text.

Well, that's about all. And, uhhh...I wouldn't exactly suggest using a parabola for interpolating the distance traveled along the arc. It would be more exact, but it would get messy, and probably be outright over most people's heads. Unless you don't mind using basic calculus and physics, that is. Use the triangle. WAY easier.
 
the ƒ is from pressing ALt + 1+5+9 at the same time then releasing them at the same time. (hint it is easier if hit alt b4 the numbers)

:D ☼§☺╒£»ƒÄ§
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Happy Thursday!
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    we were down for a minute - think a log file or something got too big
    +1
  • Ghan Ghan:
    The alerts say it was down for a while unfortunately.
  • Ghan Ghan:
    Didn't know what was going on while I was at work.
  • Ghan Ghan:
    Disk filled up with logs. Fixed now.
    +1
  • The Helper The Helper:
    not a problem at all thanks for getting us back up
  • The Helper The Helper:
    I think the bots are finding a way to get through the anubis
  • The Helper The Helper:
    Happy Wednesday Everyone! Hope everyone has a Fantastic Day!
    +1
  • The Helper The Helper:
    Yeah, stats are showing big bot influx like 12k page views.
  • Wizard Wizard:
    :wave:
    +1
  • Ghan Ghan:
    TH changed his avatar again. 6 more weeks of summer.
    +3
  • Wizard Wizard:
    lol
    +1
  • The Helper The Helper:
    Guys just a heads up I am going to be shutting the site down soon. I am just waiting on the NUON people to decide whether they want to transfer forum data and keep the discord. My email is [email protected] for anyone that wants to keep in touch and I have a facebook too. I will make an official post later. Love you guys and will miss everyone!
    +1
  • V-SNES V-SNES:
    Sent a pm @The Helper
  • Stephen Stephen:
    Oh no - please don't lose the Nuon content
    +1
  • The Helper The Helper:
    Someone email AtariAge and see if they want me to transfer the forum data over to it
  • Ghan Ghan:
    Could probably keep NUON stuff around here if we wanted.
  • Ghan Ghan:
    Hmm what to do about the World Editor site though?
  • Stephen Stephen:
    I'd rather personally just own a backup of the Nuon data than see it go to AtariAge honestly. If it gets enshittified as per usual, or if some of the "regular" Jaguar folks get there, it's not gonna be fun
  • The Helper The Helper:
    There will be a github of the forum data so the NUON Forum Data I guess would be available there
  • The Helper The Helper:
    World Editor is technically Ryoko stuff not mine you guys can keep that I am not in that even
  • jonas jonas:
    :( end of an era :(
  • The Helper The Helper:
    Dont think of it as an end jonas - think of it as a beginning, because really my friend that is what it is.

The Helper Discord

Members online

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top