円の中心。弦から半径へ「高校入試チャレンジ問題 円の面積は？」をsympyとFreeCADでやってみたい。 

・問題文は2次元ですが、３次元FreeCADのマクロで、XY平面上に作図しました。
・基本に忠実に？もあります。
# オリジナル
・YUUU0123 様 (0:00〜5:39) 

https://youtu.be/LIlZG7q376U

# sympyで(オリジナル 様の方法を参考に)
#### ver0.1  ＞相似と言えます。...
```python
# ver0.1 ＞相似と言えます。...
from sympy import *
var('l',real=True,positive=True)
AC=sqrt( 2   **2+3**2)
DC=sqrt((3-1)**2+2**2)
print("#",pi*(solve(Eq(2/DC,AC/l),l)[0]/2)**2)
# 13*pi/2
```
# sympyで(いつもの方法で)
#### ver0.2 sympyのTriangleで
・原点C,Y軸方向CBです。
class sympy.geometry.polygon.Triangle(*args, **kwargs)
A polygon with three vertices and three sides.
```python 
# ver0.2 sympyのTriangleで
from sympy import *
C=  Point(0, 0)
B=C+Point(0, 3)
A=B+Point(2, 0)
D=A+Point(0,-1)
print("#",pi*Triangle(C,A,D).circumradius**2)
# 13*pi/2
```
#### ver0.3
```python 
# ver0.3　ver0.2と同じ。s変数で、最後に値の代入。
from sympy import *
var('CB,BA,AD',real=true,positve=True)
C=  Point(0 ,0  )
B=C+Point(0 ,CB )
A=B+Point(BA,0  )
D=A+Point(0 ,-AD)
print("#", pi*Triangle(C,A,D).circumradius**2)
# 
rep={CB:3,BA:2,AD:1}
print("#",pi*(Triangle(C,A,D).circumradius**2).subs(rep))
# pi*((-AD/2 + CB)**2 + (BA**2 + CB*(AD - CB))**2/(4*BA**2))
# 13*pi/2
```
#### ver0.4 基本に忠実に？垂直２等分線で
```python 
# ver0.4　基本に忠実に？垂直２等分線で
from sympy import *
C=  Point(0, 0)
B=C+Point(0, 3)
A=B+Point(2, 0)
D=A+Point(0,-1)
CD=Line(C,D).rotate(pi/2,pt=C.midpoint(D))
DA=Line(D,A).rotate(pi/2,pt=D.midpoint(A))
M =CD.intersection(DA)[0]
print("#",pi*M.distance(C)**2)
# 13*pi/2
```
# FreeCADのマクロで作図
・問題文は2次元ですが、３次元FreeCADのマクロで、XY平面に作図しました。
・計算部分は、Ver.0.2 の コピー貼り付けです。
```python
import FreeCAD
import Part
import DraftTools
import Draft
import Mesh
############################################################################
# ver0.2 sympyのTriangleで
from sympy import *
C=  Point(0, 0)
B=C+Point(0, 3)
A=B+Point(2, 0)
D=A+Point(0,-1)
print("#",pi*Triangle(C,A,D).circumradius**2)
# 13*pi/2
############################################################################
r=Triangle(C,A,D).circumradius
M=Triangle(C,A,D).circumcenter
############################################################################
# 3D作図 z=0 XY平面に作図しました。
############################################################################
# 円の作図　FrecCADのdocより
# https://wiki.freecad.org/Macro_Circle
def Freecad3D_circle(x=0.0,y=0.0,z=0.0,radius=0.0,diameter=0.0,circumference=0.0,area=0.0,startangle=0.0,endangle=0.0,arc=0.0,anglecenter=0.0,cord=0.0,arrow=0.0,center=0,placemObject=""):
    from math import sqrt, pi
    if placemObject == "":
        pl = FreeCAD.Placement()
        pl.Rotation = FreeCADGui.ActiveDocument.ActiveView.getCameraOrientation()   
        pl.Base = FreeCAD.Vector(x,y,z)
    else:
        pl = FreeCAD.Placement()
        pl = placemObject                                  # placement imposted
    if diameter != 0:                                      # with diameter
        radius = diameter / 2.0
    elif circumference != 0:                               # with circumference
        radius = (circumference / pi) / 2.0
    elif area != 0:                                        # with area
        radius =  sqrt((area / pi))
    elif (cord != 0) and (arrow != 0):                     # with cord and arrow
        radius = ((arrow**2) + (cord**2) / 4.0) / (arrow*2) 
    elif (arc != 0) and (anglecenter != 0):                # with arc and anglecenter central in degrees
        radius = ((360/anglecenter)*arc) / pi/2.0
        if endangle != 0:
            startangle  = endangle - anglecenter
        endangle   = anglecenter + startangle
        startangle  = endangle - anglecenter
    if radius != 0:
        try:
            Draft.makeCircle(radius,placement=pl,face=False,startangle=startangle,endangle=endangle,support=None)
            if center != 0:
                x=pl.Base.x
                y=pl.Base.y
                z=pl.Base.z
                Draft.makePoint(x,y,z)
        except Exception:
            App.Console.PrintError("Unexpected keyword argument" + "\n")
        App.ActiveDocument.recompute()
    else:
        App.Console.PrintMessage("Unexpected keyword argument" + "\n")
        App.Console.PrintMessage("circle(x,y,z,radius,diameter,circumference,area,startangle,endangle,[arc,anglecenter],[cord,arrow],center,placemObject)" + "\n")
        App.Console.PrintMessage("circle(radius=10.0,placemObject=App.Placement(App.Vector(11,20,30), App.Rotation(30,40,0), App.Vector(0,0,0)))" + "\n")
    return
def myCircle_2D(myCi):
    x=myCi.center.x
    y=myCi.center.y
    r=myCi.radius
    Freecad3D_circle(
           x=float(x),y=float(y),z=0.0,
           radius=float(abs(r)),
           center=1,
           placemObject=App.Placement(App.Vector(float(x),float(y),0),
           App.Rotation(0,0,0),App.Vector(0,0,0)))
    return
def myXYZ2Txt_2D(A):
    return ""
def myXYZ2Txt_XY_2D(A):
    return '(' + str(A.x) + ',' + str(A.y) +  ')'
def myTxtXYZ_2D(A,myWedgei):
    P5x=float(A.x)
    P5y=float(A.y)
    P5z=0.0
    p5 = FreeCAD.Vector(P5x, P5y, P5z)
    myText = Draft.makeText(myWedgei, p5)
    myText.Label = myWedgei
    FreeCADGui.ActiveDocument.ActiveObject.FontSize = '0.3 mm'
    # FreeCADGui.ActiveDocument.ActiveObject.FontSize = '1.0 mm'
    # FreeCADGui.ActiveDocument.ActiveObject.FontSize = '0.5 mm'
    return
def myTxtXYZ_S_2D(*xy_tx):
    for i in range(1,int(len(xy_tx)/2)+1):
        myTxtXYZ_2D(xy_tx[2*i-2],xy_tx[2*i-1]+myXYZ2Txt_2D(xy_tx[2*i-2]) )
    return
def myTxtXYZ_XY_S_2D(*xy_tx):
    for i in range(1,int(len(xy_tx)/2)+1):
        myTxtXYZ_2D(xy_tx[2*i-2],xy_tx[2*i-1]+myXYZ2Txt_XY_2D(xy_tx[2*i-2]) )
    return
def myLine_2D(A,B):
    Ax,Ay,Az=float(A.x),float(A.y),0.0
    Bx,By,Bz=float(B.x),float(B.y),0.0
    pl = FreeCAD.Placement()
    pl.Rotation.Q = (0.4247081540122249, 0.17592004639554645, 0.33985110062924484, 0.8204732460821097)
    pl.Base = FreeCAD.Vector(-3.9166066876399563, -2.1670824762243774, 1.7495260956243028)
    points = [FreeCAD.Vector(Ax,Ay,Az), FreeCAD.Vector(Bx,By,Bz)]
    line = Draft.make_wire(points, placement=pl, closed=False, face=True, support=None)
    Draft.autogroup(line)
    return
def myLine_S_2D(*args):
    for i in range(1,len(args)):
        myLine_2D(args[i-1],args[i])
    return
def myLine_C_2D(*args):
    for i in range(1,len(args)):
        myLine_2D(args[i-1],args[i])
    myLine_2D(args[i],args[0])
    return
def myLine_H_2D(*args):
    for i in range(1,len(args)):
        myLine_2D(args[0],args[i])
    return
##################################################################################
myLine_S_2D     (M,C,B,A,D)  
myTxtXYZ_XY_S_2D(M,"M",A,"A",B,"B",C,"C",D,"D")
myCircle_2D     (Circle(M ,r ))
####################################################################################
doc = App.activeDocument()
#App.ActiveDocument.addObject("App::Origin", "Origin")
#App.ActiveDocumen!t.getObject('Origin').Visibility = True
App.ActiveDocument.recompute()
Gui.activeDocument().activeView().viewAxonometric()
Gui.SendMsgToActiveView("ViewFit")
```
isometric方向?です。(省略)
拡大図
![2.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/109698/7f708763-90fc-524e-1409-bd72f5a25bf0.png)

拡大図(CADの操作で寸法線を追加)
・(青色の)角度寸法は、ニセモノです。Part＞計測＞角度計算 です。
・角度寸法の表示は、まだ勉強中です。

![3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/109698/bf183998-7bc8-2bb3-6246-64bac0ea9bd7.png)

# いつもの? sympyの実行環境と 参考のおすすめです。
[(テンプレート)](https://qiita.com/mrrclb48z/items/00dd08b0317069be9342)

・以下ができたら、助かります。指定と全部です

https://qiita.com/mrrclb48z/items/555d85face87552c34fb

https://qiita.com/mrrclb48z/items/5f57eac92aaca30e85c0


# いつもと違うおすすめです。

## 類題

https://qiita.com/mrrclb48z/items/613ee2e5cc850b71c3ba