Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Solving equations
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
SAMBA Server
Database:
Visual FoxPro
Divers
Thread ID:
01007520
Message ID:
01007625
Vues:
11
I've changed (a,A) to (x1,y1), (b,B) to (x2,y2) since VFP is case insensitive.
*****FindCenterOfCircle.prg
LPARAMETERS x1,y1,x2,y2,r
*(x1,y1) point one
*(x2,y2) point one

LOCAL x3,y3,q,x,y
x3=(x1+x2)/2
y3=(y1+y2)/2
Q = SQRT((x2-x1)^2+(y2-y1)^2)
x = x3 + sqrt(r^2-(q/2)^2)*(y1-y2)/q
y = y3 + sqrt(r^2-(q/2)^2)*(x2-x1)/q  

x = x3 + SQRT(r^2-(q/2)^2)*(y1-y2)/q
y = y3 + SQRT(r^2-(q/2)^2)*(x1-x2)/q
?"Answer one:"
?"x=",x
?"y=",y

x = x3 - SQRT(r^2-(q/2)^2)*(y1-y2)/q
y = y3 - SQRT(r^2-(q/2)^2)*(x1-x2)/q
?"Answer two:"
?"x=",x
?"y=",y
**** FindCenterOfCircle
** In command window,type following
FindCenterOfCircle(1,4,5,1,13/2)
** This result should match your example
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform