Results 1 to 2 of 2

Thread: fastest way to calculate position

  1. #1

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    fastest way to calculate position

    What is the fastest way to calculate a position ("D)
    I have a starting point, a direction (degree in 360 system) and a length.
    I'm using the sin /cos way to get the delta for x and y and add those values. Is there a "smarter" or faster way?
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  2. #2
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: fastest way to calculate position

    temp = Direction * 0.017454
    x = Length * Sin(temp)
    y = Length * Cos(temp)

    That's about as fast as it gets really.
    I don't live here any more.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width