Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Programming challenge, gravity
Message
De
30/06/2004 20:15:45
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
30/06/2004 12:07:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00916106
Message ID:
00919448
Vues:
36
>>>Correct me if I'm wrong here, but the Gravitational formula is G*(m1*m2)/r^2. In this case, no matter how I apply the acceleration due to gravity I still need to use the pythagorean (which needs sqrt()) to find the distance (the r in the formula).
>
>Thats sort of what I thought.

Well, it seems that Mike Yearwood came up with an alternative. However, I don't think calculating a square root should be more work for the computer than calculating trigonometric functions (both use numerical methods). And the use of sqrt() is easier to read.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform