2 Replies Latest reply on Oct 29, 2008 8:11 PM by James Newton, ACP

    Measuring included angle between 3 points

    Applied CD Level 1
      I need a behavior that can measure the angle formed between two points and a sprite’s center. The first point is saved on mouseDown, the second point is the current mouse location. I’m using the law of cosines and if Director supported acos() I’d be done hours ago. I’ve got the formula re-written with atan(), unfortunately atan() presents two problems: 1. the function has singularities which I can deal with, 2. atan() returns an angle between 0<x<180, anyone know what I can test to determine if I need to add 180 to the angle to get a full 360 answer?