Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
!goto $wims_read_parm
:def
title=Equation of a circle
synonyme=circle equation
input=coord2d
!exit
:proc
#formula: center. formula2: radius
formula2=!rawmath $formula2
formula2=!trim $formula2
!if $formula2=$empty
error=empty_data
!exit
!endif
t=$[$formula2]
!if NaN isin $t or Inf isin $t
error=bad_formula
!exit
!endif
result=!exec maxima expand((x-($xx))^2+(y-($yy))^2-($formula2)^2);\
print(($formula2)^2);\
abs($formula2)*cos(t) + ($xx);\
abs($formula2)*sin(t) + ($yy);
!distribute lines $result into result, f2, px, py
direct=!rawmath (x-$xx)^2 + (y-$yy)^2 = $f2
!exit
:output
Equation of a circle with center ($xx,$yy) and radius
!htmlmath $formula2 :
<p><center>
!htmlmath $direct
, or
<p>
!htmlmath $result = 0
</center> <p>
Parametric equations
<p><center>
!htmlmath x = $px
,
!htmlmath y = $py
</center>
!exit