Omni's Arc

Omni

Ultra Cool Member
Reaction score
37
As im doing my C++ things now, i want to make the mouse move.
going from one point to another point, but moving like an arc..

if anyone knows a super mathematic formula for this, going from start point
to end while storing the point to move to everytime.

you can probably do this is JASS, just the formula and stroring the stuff in an
array of locations.

(ill make it into C++ myself :p, cant find anything about
this and this is the best forum in the world so i thought id ask here)

i'm like :confused: on this, so if anyone could show me how to do it, you'd make
me rly rly happy

if this is just impossible you can also tell me :p
 

Technomancer

New Member
Reaction score
14
Need more data, is the arc a semi-circle/oval?

If so, then you can base it around a center point, and then just use this formula:
X = DistFromPoint * scalerX * cos(angle)
Y = DistFromPoint * scalerY * sin(angle)
The bigger scalerX and scalerY are the wider/taller the arc will be respectively.

Elipses are more difficult and usually are easiest to do with d2X/d2Y (second derivatives)
dX = change in X
dY = change in Y

So X = CurrentPos + dX
Y = CurrentPos + dY

dX = dX + d2X
dY = dY + d2Y

and loop that. Constants for d2X and d2Y will give you a parabola shape, but you can use cos and sin based formulas to make it come back towards the center and create more interesting patterns.
 

Omni

Ultra Cool Member
Reaction score
37
yeah, it's part of a circle.

but idk what u mean with "ScalerX" and "ScalerY
if you can explain that..
(liek X middle of circle and Y middle of circle?)

anyway thanks :)
 

Technomancer

New Member
Reaction score
14
It's a number you pick, larger scalerX = wider oval, larger scalerY = taller oval, if they are equal it will be a perfect circle.
 
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