Need a formula

bowser499

Member
Reaction score
1
drakonaisnakemoves.jpg

Please tell me a formula of how must I do the spell?
 

inevit4ble

Well-Known Member
Reaction score
38
Ok so you cast spell x and squiggles head towards the target crossing each other periodically ending in a bang? Something similar to a Dragon Ball Z energy beam spell?

I Have no idea how to do it, I'm just trying to make it easier for someone who does know to help you
 

Romek

Super Moderator
Reaction score
963
Could you actually describe your spell with words? Images should be used to help with things that may be difficult to explain otherwise, not to show us the entire spell. It's difficult to work anything out from a static image.
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
You could use a sine wave:

298px-Sinus.svg.png


Current position (along a straight line to the target) = X
Offset from that line (perpendicular to the line to the target) = A * sin(X / (2 * 3.14 * B))

Where A is how tall half the wave should be (Example would be 75), D is the distance between the caster and the target, and B is the length of two loops (example would be 1/3 * D).

You would use a positive and negative sine wave to create the crossing paths. B would have to be chosen based on some multiple of the distance, in order for the wave to always cross right at the target.

As you can see, it's not a simple thing to do. :p
 

Attachments

  • 298px-Sinus.svg.png
    298px-Sinus.svg.png
    6.3 KB · Views: 273

Dirac

22710180
Reaction score
147
Looks like a Sin / Cos function would help you. you might want to dig into that. I also suggest you to use my vCircles snippet, has a great power when dealing with this things
I found very funny that you draw a phoenix at the first post

EDIT: *headshot* by darthfett
 

bowser499

Member
Reaction score
1
JASS:
function GetSineOffsetX takes real curx, real dseg, real a returns real
    return curx + dseg * Cos(a)
endfunction

function GetSineOffsetY takes real curx, real dseg, real tall, real a returns real
    return tall * Sin((GetSineOffsetX(curx,dseg,a)/(2.*3.14*400.))*.0174532)
endfunction

What I've done wrong?
 

WolfieeifloW

WEHZ Helper
Reaction score
372
You should probably tell us what the problem is, instead of making us figure it out :p
Tell us what is going on, what's wrong, what's right, then post your code.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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