mercredi 16 août 2017

Generating a, b, c such that a^2 + b^2 + c^2 = 1

To do some simulations in Python, I'm trying to generate numbers a,b,c such that a2 + b2 + c2 = 1, where a2 = a^2. I think generating some a between 0 and 1, then some b between a and 1, and then c = 1 - a - b would work.

Being new to Python, I'm not really sure how to do this. Any help would be great, thanks!




Aucun commentaire:

Enregistrer un commentaire