入力(半径)に従ってオリンピックリングが描かれているプログラムを入力しています。私の質問は、入力を与えられたら、それに応じて位置座標(x、y)をどのように取得するのですか?サークルの半径(Python)を指定して位置座標を調整しようとしています
私はすべてのマッチアップにそれらのために持っていたデフォルトの半径70は70
を入力している。ここに私のコードです:
radius =input('Enter the radius of your circle: ') #Asking for radius of the circle
r = float(radius)
import turtle
t = turtle.Turtle
t = turtle.Turtle(shape="turtle")
#Circle one
t.pensize(10)
t.penup()
t.goto(0,0)
t.pendown()
t.color("green") #Adds Green
t.circle(r)
#Circle two
t.penup()
t.setposition(-160,0)
t.pendown()
t.color("yellow") #Adds yellow
t.circle(r)
#Circle three
t.penup()
t.setposition(110,60)
t.pendown()
t.color("red") #Adds red
t.circle(r)
#Circle four
t.penup()
t.setposition(-70,60)
t.pendown()
t.color("black") #Adds black
t.circle(r)
#Circle five
t.penup()
t.setposition(-240,60)
t.pendown()
t.color("blue") #Adds blue
t.circle(r)
助けを借りてくれてありがとう。私は今それをやる方法を理解しています。 – MLW