» codelab : http://codelab.fr/accueil » Forum : Processing : http://codelab.fr/processing » cercle inscrit : http://codelab.fr/7216 Ceci est la version imprimable d'un sujet du forum, pour retourner à la version complète : cercle inscrit |
matheynen — 2019-07-08 13:46:11 |
Bonjour, |
matheynen — 2019-07-08 14:51:06 |
J'ai trouvé, j'ai repris du code Java : PVector inCentre(PVector a, PVector b, PVector c) { float len0 = b.dist(c); float len1 = a.dist(c); float len2 = a.dist(b); float circum = len0 + len1 + len2; float inCentreX = (len0 * a.x + len1 * b.x +len2 * c.x) / circum; float inCentreY = (len0 * a.y + len1 * b.y +len2 * c.y) / circum; return new PVector(inCentreX, inCentreY); } Ha, il faut toujours chercher 7 fois sur google avant de poster sur un forum |