Draw seven leaf program code, a great god genuflect is begged
Time:11-19
Which a great god can ah, please answer, please hurry, river's lake emergency,
CodePudding user response:
Turerle library? Homework is a python
CodePudding user response:
Without the turtle mapping, pure painting was calculated by the mathematical I can show off in an ostentatious manner, you use the homework must be out,
Const Pi=3.14159265 Private Sub Command1_Click () Me. The ScaleMode=3 Me. Cls Dim x As Double circle ' Dim As Double y Dim D As Double 'center to center distance Dim As Double 'circle radius R Dim As Double C 'center to focus distance Dim delta As a Double curve radian 'D=50 R=40 'with cosine theorem for center distance to the center of the intersection point (tips to C=Cos (2 * D * (Pi/7) + Sqr (Cos (2 * D * (Pi/7)) ^ 2-4 * (D ^ 2 - R ^ 2)))/2 'with a cosine theorem to get the radian of arc Delta=ArcCos ((D + R ^ 2 ^ 2 C ^ 2)/(2 * D * R)) Dim As Integer I
For I=1 To 7 'painting lines Me. Circle (Me. ScaleWidth/2 + Cos (2 * Pi/7) * (I - 1)) * D Me. ScaleHeight/2 + Sin (7) (2 * Pi/* (I - 1)) * D), R, vbRed, DblMod (((2 * Pi/7) * (8 - I) + Pi - delta), (2 * Pi)), DblMod (((2 * Pi/7) * (8 - I) + Pi + delta), (2 * Pi)) Next End Sub 'floating modulus Private Function DblMod (dbl1 As Double, dbl2 As Double) Dim TMP As Double TMP=Fix (dbl1/dbl2) TMP DblMod=dbl1 - dbl2 * End the Function The arccosine 'The Function ArcCos (x As Double) As a Double If x & gt;=1 And x & lt; 0.5 Then ArcCos=Atn (Sqr (1 -) x x x/x) + 4 * Atn (1) If x & gt;=0.5 And x & lt;=0.5 Then ArcCos=- Atn (x/Sqr (1 -) x x x) + 2 * Atn (1) If x & gt; And 0.5 x & lt;=1 Then ArcCos=Atn (Sqr (1 -) x x x/x) End the Function