Sub Symetrie_centrale
'variables
Dim xa As String, xb As String, xc As String, ya As String, yb As String, yc As String
Dim xo As String, yo As String
Dim xd As Double, xe As Double, xf As Double, yd As Double, ye As Double, yf As Double
'variables objets
Dim LesFeuilles as Object
Dim PremiereFeuille as Object
Dim Cellule as Object
'Initialisation
LesFeuilles = ThisComponent.Sheets
PremiereFeuille = LesFeuilles.GetbyName("Feuil1")
Cellule = PremiereFeuille.GetCellByPosition(3,4)
Cellule.String=""
Cellule = PremiereFeuille.GetCellByPosition(3,5)
Cellule.String=""
Cellule = PremiereFeuille.GetCellByPosition(3,7)
Cellule.String=""
Cellule = PremiereFeuille.GetCellByPosition(3,8)
Cellule.String=""
Cellule = PremiereFeuille.GetCellByPosition(3,10)
Cellule.String=""
Cellule = PremiereFeuille.GetCellByPosition(3,11)
Cellule.String=""
Cellule = PremiereFeuille.GetCellByPosition(3,13)
Cellule.String=""
Cellule = PremiereFeuille.GetCellByPosition(3,14)
Cellule.String=""
Cellule = PremiereFeuille.GetCellByPosition(3,18)
Cellule.String=""
Cellule = PremiereFeuille.GetCellByPosition(3,19)
Cellule.String=""
Cellule = PremiereFeuille.GetCellByPosition(3,21)
Cellule.String=""
Cellule = PremiereFeuille.GetCellByPosition(3,22)
Cellule.String=""
Cellule = PremiereFeuille.GetCellByPosition(3,24)
Cellule.String=""
Cellule = PremiereFeuille.GetCellByPosition(3,25)
Cellule.String=""
'Saisie des données et affichage des valeurs saisies
xo = InputBox("Donner l'abscisse du point O", "Coordonnées du point O", 5)
If xo = "" Then Exit Sub
Cellule = PremiereFeuille.GetCellByPosition(3,4)
Cellule.Value = Val(xo)
yo = InputBox("Donner l'ordonnée du point O", "Coordonnées du point O", 4)
If yo = "" Then Exit Sub
Cellule = PremiereFeuille.GetCellByPosition(3,5)
Cellule.Value=Val(yo)
xa = InputBox("Donner l'abscisse du point A", "Coordonnées du point A", 3)
If xa = "" Then Exit Sub
Cellule = PremiereFeuille.GetCellByPosition(3,7)
Cellule.Value=Val(xa)
ya = InputBox("Donner l'ordonnée du point A", "Coordonnées du point A", 6)
If ya = "" Then Exit Sub
Cellule = PremiereFeuille.GetCellByPosition(3,8)
Cellule.Value=Val(ya)
xb = InputBox("Donner l'abscisse du point B", "Coordonnées du point B", 2)
If xb = "" Then Exit Sub
Cellule = PremiereFeuille.GetCellByPosition(3,10)
Cellule.Value=Val(xb)
yb = InputBox("Donner l'ordonnée du point B", "Coordonnées du point B", 4)
If yb = "" Then Exit Sub
Cellule = PremiereFeuille.GetCellByPosition(3,11)
Cellule.Value=Val(yb)
xc = InputBox("Donner l'abscisse du point C", "Coordonnées du point C", 4)
If xc = "" Then Exit Sub
Cellule = PremiereFeuille.GetCellByPosition(3,13)
Cellule.Value=Val(xc)
yc = InputBox("Donner l'ordonnée du point C", "Coordonnées du point C", 3)
If yc = "" Then Exit Sub
Cellule = PremiereFeuille.GetCellByPosition(3,14)
Cellule.Value=Val(yc)
'Calculs
'des coordonnées de A'
xd = 2 * val(xo) - val(xa)
yd = 2 * val(yo) - val(ya)
'des coordonnées de B'
xe = 2 * val(xo) - val(xb)
ye = 2 * val(yo) - val(yb)
'des coordonnées de C'
xf = 2 * val(xo) - val(xc)
yf = 2 * val(yo) - val(yc)
'affichage des résultats
Cellule = PremiereFeuille.GetCellByPosition(3,18)
Cellule.Value=xd
Cellule = PremiereFeuille.GetCellByPosition(3,19)
Cellule.Value=yd
Cellule = PremiereFeuille.GetCellByPosition(3,21)
Cellule.Value=xe
Cellule = PremiereFeuille.GetCellByPosition(3,22)
Cellule.Value=ye
Cellule = PremiereFeuille.GetCellByPosition(3,24)
Cellule.Value=xf
Cellule = PremiereFeuille.GetCellByPosition(3,25)
Cellule.Value=yf
End Sub