Results 1 to 1 of 1

Thread: Calculate the starting point of my vector in relation to COS ???

  1. #1
    Mar 2012

    Calculate the starting point of my vector in relation to COS ???

    Hi im making a game and I am struggling to get the maths right for a function im writing to move a object/vector around another object/vector in a circular movement. I have the function working ok except for one thing, which is the correct value to set my increment variable to start my circular movement.

    Let me show you the function and it should make more sense.
      local radius = 140   -- Radius of the circle
      local cosCounter = 0  -- starting point of the cosCounter
      local spinAround = function(self,tDelta,targetY,targetX)  
           object.x = math.sin(cosCounter)*radius + targetX
           object.y = math.cos(cosCounter)*radius + targetY
           cosCounter = cosCounter - tDelta* 0.01 -- speed of the object ( + is clockwise )
    Can someone please tell how I can set the value cosCounter to be at the same position as my object from x/y coords, which will be some where along the radius of the target???

    Many thanks.
    Last edited by Beloudest; Mar 14th 2012 at 09:54 AM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. starting point for this integral?
    Posted in the Calculus Forum
    Replies: 1
    Last Post: Sep 23rd 2011, 10:58 AM
  2. Starting point for Riemann sum, Integral proof?
    Posted in the Differential Geometry Forum
    Replies: 8
    Last Post: Feb 11th 2010, 06:10 AM
  3. I need a starting point for this problem!
    Posted in the Algebra Forum
    Replies: 1
    Last Post: Feb 6th 2010, 07:10 AM
  4. need a starting point urgently.
    Posted in the Math Topics Forum
    Replies: 3
    Last Post: Jan 19th 2009, 06:59 AM
  5. Mathematics...a starting point?
    Posted in the Math Topics Forum
    Replies: 4
    Last Post: Nov 19th 2008, 06:47 PM

Search Tags

/mathhelpforum @mathhelpforum