Anonymous user
Circles of given radius through two points: Difference between revisions
Circles of given radius through two points (view source)
Revision as of 17:56, 22 November 2021
, 2 years agoUsing Real Math module
(Added solution for Action!) |
(Using Real Math module) |
||
Line 126:
=={{header|Action!}}==
{{libheader|Action! Tool Kit}}
{{libheader|Action! Real Math}}
<lang Action!>INCLUDE "
PROC Circles(CHAR ARRAY sx1,sy1,sx2,sy2,sr)
REAL x1,y1,x2,y2,r,x,y,bx,by,pb,cb,xx,yy
REAL
ValR(sx1,x1) ValR(sy1,y1)
ValR(sx2,x2) ValR(sy2,y2)
ValR(sr,r)
Print("p1=(") PrintR(x1) Put(32)
Line 183 ⟶ 142:
Print(") r=") PrintR(r) Print(" -> ")
IF
PrintE("Radius is zero, no circles") PutE()
RETURN
Line 202 ⟶ 161:
Sqrt(tmp3,pb) ;pb=sqrt(x^2+y^2)
IF
PrintE("Infinite circles")
ELSEIF
PrintE("Points are too far, no circles")
ELSE
Line 235 ⟶ 194:
PROC Main()
Put(125) PutE() ;clear the screen
MathInit()
Circles("0.1234","0.9876","0.8765","0.2345","2.0")
Circles("0.0000","2.0000","0.0000","0.0000","1.0")
|