Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Oiling my tablet
Message
De
29/04/2013 11:48:55
 
 
À
29/04/2013 11:36:18
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Javascript
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01572116
Message ID:
01572172
Vues:
49
>>The problem with the first approach was 180 degrees. That was the source of the wrong results
>>
>>I was looking into sin and cos
>>
>>ps: Add a test for c == 0 ( ie 90 or 270 degrees)
>>
>>pps: How are you going to make the distinction between quadrants I and III ( same for II and IV)
>
>You can always turn to arc cotangent when you cross over 45 degrees, i.e. when the y axis segment is larger than the x axis segment.
>
>As for the quadrants, there's always checking the sign of the segments, i.e. which is positive which is negative. Going by segments, x and y are ++, -+. --, +-.

Figured that out - took an old book (dated 1974)


But Math.Atan2( sin, cos) seems to take care of the quadrants
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform