J'ai une sphère et un vecteur avec deux
(x_1,y_1,z_1), je recherche le plan tangent à cette sphère qui contient les deux points P et Q. Bon on sait qu'il va y avoir deux solutions.
on va dire que le point est le point tangent à la sphère.
Comme X appartient à la sphère il vérifie:
de même le vecteur sera le vecteur normal au plan tangent à la sphère. Le plan contient X donc l'équation du plan est
donc
Le plan passe par P et Q ce qui nous donne:
Il faut donc résoudre les trois équations:
A partir de (1) :
on réintroduit dans (2):
donc
ou plus simplement
avec et
On réintroduit (5) dans (4):
avec
Maintenant on utilise (5) et (6) dans (3):
On obtient une équation du second degré qui va nous donner deux valeurs pour et on utilise ces deux valeurs pour calculer
avec (5) et
avec (6).
Malheureusement ca ne fonctionne pas car les valeurs calculées ne vérifient pas .Cela veut dire que j'ai du faire une erreur quelque part mais je ne sais pas où.... Alors si une bonne âme pouvait regarder je lui en serais très reconnaissant
Bonjour, oui effectivement cela simplifiera A et B, merci. Par ailleurs voyez vous des erreurs dans la démarche? Merci bien
à priori non je ne vois pas d'erreurs dans la démarche ... donc il faut reprendre les calculs littéraux ...
une remarque cependant si O (origine et centre de la sphère), P et Q sont alignés il n'y a pas de solution : (x_1, y_1, z_1) et (x_2, y_2, z_2) sont proportionnels
donc à un moment dans le calcul le pb doit apparaître ("genre une division par 0" par exemple)
salut,
Quel est le but final de ce probleme ?
Pour info voici le code latex de alpha qui refuse de s'afficher correctement:
\frac{(r^{2}-\frac{\mathrm{y1} (r^{2}\cdot \mathrm{x1}-r^{2}\cdot \mathrm{x2}-\frac{\mathrm{x1}\cdot \mathrm{z2} (\sqrt{-r^{2}\cdot \mathrm{x1}^{2}-r^{2}\cdot \mathrm{x2}^{2}-r^{2}\cdot \mathrm{y1}^{2}-r^{2}\cdot \mathrm{y2}^{2}-r^{2}\cdot \mathrm{z1}^{2}-r^{2}\cdot \mathrm{z2}^{2}+\mathrm{x1}^{2}\cdot \mathrm{y2}^{2}+\mathrm{x1}^{2}\cdot \mathrm{z2}^{2}+\mathrm{x2}^{2}\cdot \mathrm{y1}^{2}+\mathrm{x2}^{2}\cdot \mathrm{z1}^{2}+\mathrm{y1}^{2}\cdot \mathrm{z2}^{2}+\mathrm{y2}^{2}\cdot \mathrm{z1}^{2}+2\cdot r^{2}\cdot \mathrm{x1}\cdot \mathrm{x2}+2\cdot r^{2}\cdot \mathrm{y1}\cdot \mathrm{y2}+2\cdot r^{2}\cdot \mathrm{z1}\cdot \mathrm{z2}-2\cdot \mathrm{x1}\cdot \mathrm{x2}\cdot \mathrm{y1}\cdot \mathrm{y2}-2\cdot \mathrm{x1}\cdot \mathrm{x2}\cdot \mathrm{z1}\cdot \mathrm{z2}-2\cdot \mathrm{y1}\cdot \mathrm{y2}\cdot \mathrm{z1}\cdot \mathrm{z2}} |r\cdot \mathrm{x1}\cdot \mathrm{y2}-r\cdot \mathrm{x2}\cdot \mathrm{y1}|+r^{2}\cdot \mathrm{x1}^{2}\cdot \mathrm{z2}+r^{2}\cdot \mathrm{x2}^{2}\cdot \mathrm{z1}+r^{2}\cdot \mathrm{y1}^{2}\cdot \mathrm{z2}+r^{2}\cdot \mathrm{y2}^{2}\cdot \mathrm{z1}-r^{2}\cdot \mathrm{x1}\cdot \mathrm{x2}\cdot \mathrm{z1}-r^{2}\cdot \mathrm{x1}\cdot \mathrm{x2}\cdot \mathrm{z2}-r^{2}\cdot \mathrm{y1}\cdot \mathrm{y2}\cdot \mathrm{z1}-r^{2}\cdot \mathrm{y1}\cdot \mathrm{y2}\cdot \mathrm{z2})}{(\mathrm{x1}^{2}\cdot \mathrm{y2}^{2}+\mathrm{x1}^{2}\cdot \mathrm{z2}^{2}+\mathrm{x2}^{2}\cdot \mathrm{y1}^{2}+\mathrm{x2}^{2}\cdot \mathrm{z1}^{2}+\mathrm{y1}^{2}\cdot \mathrm{z2}^{2}+\mathrm{y2}^{2}\cdot \mathrm{z1}^{2}-2\cdot \mathrm{x1}\cdot \mathrm{x2}\cdot \mathrm{y1}\cdot \mathrm{y2}-2\cdot \mathrm{x1}\cdot \mathrm{x2}\cdot \mathrm{z1}\cdot \mathrm{z2}-2\cdot \mathrm{y1}\cdot \mathrm{y2}\cdot \mathrm{z1}\cdot \mathrm{z2})}+\frac{\mathrm{x2}\cdot \mathrm{z1} (\sqrt{-r^{2}\cdot \mathrm{x1}^{2}-r^{2}\cdot \mathrm{x2}^{2}-r^{2}\cdot \mathrm{y1}^{2}-r^{2}\cdot \mathrm{y2}^{2}-r^{2}\cdot \mathrm{z1}^{2}-r^{2}\cdot \mathrm{z2}^{2}+\mathrm{x1}^{2}\cdot \mathrm{y2}^{2}+\mathrm{x1}^{2}\cdot \mathrm{z2}^{2}+\mathrm{x2}^{2}\cdot \mathrm{y1}^{2}+\mathrm{x2}^{2}\cdot \mathrm{z1}^{2}+\mathrm{y1}^{2}\cdot \mathrm{z2}^{2}+\mathrm{y2}^{2}\cdot \mathrm{z1}^{2}+2\cdot r^{2}\cdot \mathrm{x1}\cdot \mathrm{x2}+2\cdot r^{2}\cdot \mathrm{y1}\cdot \mathrm{y2}+2\cdot r^{2}\cdot \mathrm{z1}\cdot \mathrm{z2}-2\cdot \mathrm{x1}\cdot \mathrm{x2}\cdot \mathrm{y1}\cdot \mathrm{y2}-2\cdot \mathrm{x1}\cdot \mathrm{x2}\cdot \mathrm{z1}\cdot \mathrm{z2}-2\cdot \mathrm{y1}\cdot \mathrm{y2}\cdot \mathrm{z1}\cdot \mathrm{z2}} |r\cdot \mathrm{x1}\cdot \mathrm{y2}-r\cdot \mathrm{x2}\cdot \mathrm{y1}|+r^{2}\cdot \mathrm{x1}^{2}\cdot \mathrm{z2}+r^{2}\cdot \mathrm{x2}^{2}\cdot \mathrm{z1}+r^{2}\cdot \mathrm{y1}^{2}\cdot \mathrm{z2}+r^{2}\cdot \mathrm{y2}^{2}\cdot \mathrm{z1}-r^{2}\cdot \mathrm{x1}\cdot \mathrm{x2}\cdot \mathrm{z1}-r^{2}\cdot \mathrm{x1}\cdot \mathrm{x2}\cdot \mathrm{z2}-r^{2}\cdot \mathrm{y1}\cdot \mathrm{y2}\cdot \mathrm{z1}-r^{2}\cdot \mathrm{y1}\cdot \mathrm{y2}\cdot \mathrm{z2})}{(\mathrm{x1}^{2}\cdot \mathrm{y2}^{2}+\mathrm{x1}^{2}\cdot \mathrm{z2}^{2}+\mathrm{x2}^{2}\cdot \mathrm{y1}^{2}+\mathrm{x2}^{2}\cdot \mathrm{z1}^{2}+\mathrm{y1}^{2}\cdot \mathrm{z2}^{2}+\mathrm{y2}^{2}\cdot \mathrm{z1}^{2}-2\cdot \mathrm{x1}\cdot \mathrm{x2}\cdot \mathrm{y1}\cdot \mathrm{y2}-2\cdot \mathrm{x1}\cdot \mathrm{x2}\cdot \mathrm{z1}\cdot \mathrm{z2}-2\cdot \mathrm{y1}\cdot \mathrm{y2}\cdot \mathrm{z1}\cdot \mathrm{z2})})}{(\mathrm{x1}\cdot \mathrm{y2}-\mathrm{x2}\cdot \mathrm{y1})}-\frac{\mathrm{z1} (\sqrt{-r^{2}\cdot \mathrm{x1}^{2}-r^{2}\cdot \mathrm{x2}^{2}-r^{2}\cdot \mathrm{y1}^{2}-r^{2}\cdot \mathrm{y2}^{2}-r^{2}\cdot \mathrm{z1}^{2}-r^{2}\cdot \mathrm{z2}^{2}+\mathrm{x1}^{2}\cdot \mathrm{y2}^{2}+\mathrm{x1}^{2}\cdot \mathrm{z2}^{2}+\mathrm{x2}^{2}\cdot \mathrm{y1}^{2}+\mathrm{x2}^{2}\cdot \mathrm{z1}^{2}+\mathrm{y1}^{2}\cdot \mathrm{z2}^{2}+\mathrm{y2}^{2}\cdot \mathrm{z1}^{2}+2\cdot r^{2}\cdot \mathrm{x1}\cdot \mathrm{x2}+2\cdot r^{2}\cdot \mathrm{y1}\cdot \mathrm{y2}+2\cdot r^{2}\cdot \mathrm{z1}\cdot \mathrm{z2}-2\cdot \mathrm{x1}\cdot \mathrm{x2}\cdot \mathrm{y1}\cdot \mathrm{y2}-2\cdot \mathrm{x1}\cdot \mathrm{x2}\cdot \mathrm{z1}\cdot \mathrm{z2}-2\cdot \mathrm{y1}\cdot \mathrm{y2}\cdot \mathrm{z1}\cdot \mathrm{z2}} |r\cdot \mathrm{x1}\cdot \mathrm{y2}-r\cdot \mathrm{x2}\cdot \mathrm{y1}|+r^{2}\cdot \mathrm{x1}^{2}\cdot \mathrm{z2}+r^{2}\cdot \mathrm{x2}^{2}\cdot \mathrm{z1}+r^{2}\cdot \mathrm{y1}^{2}\cdot \mathrm{z2}+r^{2}\cdot \mathrm{y2}^{2}\cdot \mathrm{z1}-r^{2}\cdot \mathrm{x1}\cdot \mathrm{x2}\cdot \mathrm{z1}-r^{2}\cdot \mathrm{x1}\cdot \mathrm{x2}\cdot \mathrm{z2}-r^{2}\cdot \mathrm{y1}\cdot \mathrm{y2}\cdot \mathrm{z1}-r^{2}\cdot \mathrm{y1}\cdot \mathrm{y2}\cdot \mathrm{z2})}{(\mathrm{x1}^{2}\cdot \mathrm{y2}^{2}+\mathrm{x1}^{2}\cdot \mathrm{z2}^{2}+\mathrm{x2}^{2}\cdot \mathrm{y1}^{2}+\mathrm{x2}^{2}\cdot \mathrm{z1}^{2}+\mathrm{y1}^{2}\cdot \mathrm{z2}^{2}+\mathrm{y2}^{2}\cdot \mathrm{z1}^{2}-2\cdot \mathrm{x1}\cdot \mathrm{x2}\cdot \mathrm{y1}\cdot \mathrm{y2}-2\cdot \mathrm{x1}\cdot \mathrm{x2}\cdot \mathrm{z1}\cdot \mathrm{z2}-2\cdot \mathrm{y1}\cdot \mathrm{y2}\cdot \mathrm{z1}\cdot \mathrm{z2})})}{\mathrm{x1}}
on peut peut etre simplifier àla main
autrefois sur ce site on aurait afficher convenablement alpha
Maintenant c'est illisible
Vous pouvez essayer en mettant ce code entre les balises tex
Le problème original est décrit sur la figure qui doit être attaché à ce message. Il s'agit en fait d'un robot humanoïde avec un pied articulé et avec une jambe dont la cuisse fait un angle avec le "tibia" si je puis dire.
Le problème consiste à trouver l'inclinaison de la jambe plus celle des différentes articulations connaissant la position du bassin et du pied.
Une solution à ce problème consiste à voir une sphère centré sur le pivot du bassin et un plan passant par le point représentant la cheville
de direction
(l'inclinaison du pied) qui sera tangent à la sphère en
.
représente une distance constante quelque soit la rotation de la cuisse par rapport au genou.
J'essaie de trouver une solution géométrique pour éviter de rentrer dans la résolution dites "cinématique inverse" via des matrices de rotation homogènes...
J'espère que j'ai clairement énoncé le problème?
J'ai mis toutes les équations entre balises Tex justement - et pour moi tout apparait comme il faut...
des retours ligne ? mais c'est une seule expression !
Sujet passionnant mais le calcul formel est-il indispensable ?
Des valeurs approchees ne suffisent-elles pas ?
Il suffit d'ecrire le programme de calcul
bonjour
programme de calcul? Je ne suis pas sur de bien saisir... la résolution passe par des équations. Et j'ai l'impression que le raisonnement pour obtenir les 3 premières équations est juste mais je n'arrive pas trouver les 3 paramètres .
Il doit y avoir une solution géométrique aussi je pense.
Par exemple avec le logiciel Xcas
EquationPlan(x1,y1,z1,x2,y2,z2,r):={
eq1:=a*x1+b*y1+c*z1=r^2;
eq2:=a*x2+b*y2+c*z2=r^2;
eq3:=a^2+b^2+c^2=r^2;
S:=solve([eq1,eq2,eq3],[a,b,c]);
retourne S;
}:;
Pour avoir les equations des plans
EquationPlan(x1,y1,z1,x2,y2,z2,r):={
eq1:=a*x1+b*y1+c*z1=r^2;
eq2:=a*x2+b*y2+c*z2=r^2;
eq3:=a^2+b^2+c^2=r^2;
S:=solve([eq1,eq2,eq3],[a,b,c]);
retourne [[S[0][0]*x+S[0][1]*y+S[0][2]*z=r^2],[S[1][0]*x+S[1][1]*y+S[1][2]*z=r^2]]
}:;
Avec ce logiciel, effectivement ça marche!
Maintenant je ne comprends pas pourquoi je n'arrive pas à obtenir ce résultat à partir du calcul (nécessaire parce que je dois calculer ce plan de façon itérative en fonction du mouvement).
Je ne vois pas mon (mes) erreur(s), ce qui est frustrant parce que c'est un système d'équations relativement simple quand même.
A confirmer:
EquationsPlans(x1,y1,z1,x2,y2,z2,r):={
A:=point(x1,y1,z1);
B:=point(x2,y2,z2);
eq1:=a*x1+b*y1+c*z1=r^2;
eq2:=a*x2+b*y2+c*z2=r^2;
eq3:=a^2+b^2+c^2=r^2;
S:=solve([eq1,eq2,eq3],[a,b,c]);
retourne equation(plan(A,B,S[0])),equation(plan(A,B,S[1]))
}:;
sphere(point(0,0,0),1);
A:=point(1,2,3);
B:=point(6,7,8);
plan(EquationsPlans(1,2,3,6,7,8,1)[0]);
plan(EquationsPlans(1,2,3,6,7,8,1)[1]);
Xcas montre bien qu'on peut trouver des solutions et je m'en réjouis mais je ne peux pas utiliser Xcas dans mon cas de figure. Hélas j'ai besoin de trouver les solutions par le calcul... mais je n'y parviens pas.
Si je je trouve en fonction de
à l'aide des équations (1) et (2), normalement je peux réinjecter cette expression dans l'équation (1), par exemple, pour trouver
qui sera fonction de
?
Ensuite ayant et
fonction de
, utiliser l'équation (3) pour calculer les 2 valeurs de
?
la démarche est cohérente
En découpant là où certaines lignes de code Latex semblent hasardeuses ...
On obtient ceci pour le message Latex qui foire.
\frac{(r^{2}-\frac{\mathrm{y1} (r^{2}\cdot \mathrm{x1}-r^{2}\cdot \mathrm{x2}-\frac{\mathrm{x1}\cdot \mathrm{z2} (\sqrt{-r^{2}\cdot \mathrm{x1}^{2}-r^{2}\cdot
\mathrm{y2}\cdot \mathrm{z1}\cdot \mathrm{z2})}+\frac{\mathrm{x2}\cdot \mathrm{z1} (\sqrt{-r^{2}\cdot \mathrm{x1}^{2}-r^{2}\cdot
\mathrm{y2}\cdot \mathrm{z1}\cdot \mathrm{z2})}+\frac{\mathrm{x2}\cdot
\mathrm{z1} (\sqrt{-r^{2}\cdot \mathrm{x1}^{2}-r^{2}\cdot \mathrm{x2}^{2}-
r^{2}\cdot \mathrm{y1}^{2}-r^{2}\cdot \mathrm{y2}^{2}-r^{2}\cdot \mathrm{z1}^{2}-r^{2}\cdot \mathrm{z2}^{2}+\mathrm{x1}^{2}\cdot
\mathrm{y2}\cdot \mathrm{z1}\cdot \mathrm{z2})})}{(\mathrm{x1}\cdot \mathrm{y2}-\mathrm{x2}\cdot \mathrm{y1})}-\frac{\mathrm{z1} (\sqrt{-r^{2}\cdot
\mathrm{z2}-2\cdot \mathrm{y1}\cdot \mathrm{y2}\cdot \mathrm{z1}\cdot \mathrm{z2})})}{\mathrm{x1}}
Cela devrait permettre de corriger les bugs plus facilement.
le pb c'est qu'il y a une enorme racine carree
ll suffit d'utiliser Xcas pour avoir un affichage correct
je vais essayer de calculer comme fabrice23 mais avec Xcas
tes calculs sont exacts du debut à la fin
la resolution de ta derniere equation donne les bons resultats pour c ie gamma pour toi
le script Xcas de verif:
eq1:=a*x1+b*y1+c*z1=r^2;
eq2:=a*x2+b*y2+c*z2=r^2;
eq3:=a^2+b^2+c^2=r^2;
eq4:=solve(eq1,a)
S1:=solve(subst(eq2,a=(r^2-b*y1-c*z1)/x1),b)
A,B:=coeff(S1[0],c)//ok
S2:=(r^2-('A'*c+'B')*y1-c*z1)/x1
C,D:=coeff((-y1*('A'*c+'B')+r^2-c*z1)/x1,c)
S3:=('C'*c+'D')^2+('A'*c+'B')^2+c^2-r^2
coeff(c^2-r^2+('A'*c+'B')^2+('C'*c+'D')^2,c)
solve(c^2-r^2+(A*c+B)^2+(C*c+D)^2,c)
x1,y1,z1,x2,y2,z2,r:=1,2,3,7,8,9,1 // verif sur un exemple
solve(c^2-r^2+(A*c+B)^2+(C*c+D)^2,c)
la derniere commande renvoie:
confirmes par les programmes que j'ai indiques precedemment
conclusion:
tu as mal resolu ton equation en gamma
Vous devez être membre accéder à ce service...
Pas encore inscrit ?
1 compte par personne, multi-compte interdit !
Ou identifiez-vous :