angles2tranlations

This forum is currently in read-only mode.
  • what i mean here is i want an object to move in the direction of a given angle, using coordinate translations, for a custom movement, now i have been developing something similar to this but i havnt gotten everything, its basically a formula which you input an angle and it returns to you scaled values so it will still move 1pxl per second, but in the angle of the given angle, meaning 45 would return to you something like 0.7y 0.7x understand (seperately of course)? then you scale your value according to those given numbers by multiplying them by it.

    i was just wondering if this existed already, because i made this all by myself but im sure some 1700's mathematician has already done it lol. so is there a way?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • So speaking simple you want to ball move slower if the angle is rising

    Sounds like Cosinus to me.

    Cosinus give value of 1 when the angle is 0 and gives value of 0 when the angle is 90. Like here

    <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/da/Cosinus.svg/298px-Cosinus.svg.png">

    btw ? is = 180 degrees

  • man you really need to learn trig !

    set X to .x+speed*cos(angle)

    set Y to .y+speed*sin(angle)

    what you want are actually the sin and cos functions themselves!

    they go from -1 to 1 like the picture above, if you plot X=cosA and Y=sinA for every value of A, it will give you a circle with radius 1.

    so if the angle is 0, (you're going horizontally to the right) cos(angle) gives 1, and sin angle gives 0, so you'll be moving 1 to the right. if angle is 90 (vertical) sin(angle) gives 1, and you're Y will be moving correctly.

    It's tempting to make a trigonometry 101 page for the wiki, though I've been doing it for so long I don't know what it's like for someone who's never learnt it .

    [quote:kgmy9vbb]i was just wondering if this existed already, because i made this all by myself but im sure some 1700's mathematician has already done it lol. so is there a way?

    try some 4000 year old mathematician lol

  • [quote:jxwk366c]try some 4000 year old mathematician lol

    lol, thats all i have to say

    and a trig 101 would be useful to us who learn faster than the schools can teach us

    im amazed i thought of such things! i would of been inventing the wheel in my own way !

    wow, i just realised ive understood trig all along, i just need a 101 page

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)