10import matplotlib.pyplot
as plt
13INNER_RADIUS, OUTER_RADIUS = 7.625, 10.625
15CENTER_X, CENTER_Y = 9.125, 0
16START_LINE, END_LINE = -15.0, 15.0
43for angle
in np.arange(math.pi, -math.pi, -2 * math.pi / coneDivisions):
45 x = CENTER_X + INNER_RADIUS * math.cos(angle)
46 y = CENTER_Y + INNER_RADIUS * math.sin(angle)
47 x =
round(x, ROUND_CASES)
48 y =
round(y, ROUND_CASES)
51 colorList.append(
"#ff0000")
54for angle
in np.arange(0, 2 * math.pi, 2 * math.pi / coneDivisions):
56 x = -CENTER_X + INNER_RADIUS * math.cos(angle)
57 y = CENTER_Y + INNER_RADIUS * math.sin(angle)
58 x =
round(x, ROUND_CASES)
59 y =
round(y, ROUND_CASES)
62 colorList.append(
"#0000ff")
65for angle
in np.arange(
66 3 * math.pi / 4, -6.9 * math.pi / 8, -2 * math.pi / coneDivisions
69 x = CENTER_X + OUTER_RADIUS * math.cos(angle)
70 y = CENTER_Y + OUTER_RADIUS * math.sin(angle)
71 x =
round(x, ROUND_CASES)
72 y =
round(y, ROUND_CASES)
75 colorList.append(
"#0000ff")
78for angle
in np.arange(math.pi / 4, 15 * math.pi / 8, 2 * math.pi / coneDivisions):
80 x = -CENTER_X + OUTER_RADIUS * math.cos(angle)
81 y = CENTER_Y + OUTER_RADIUS * math.sin(angle)
82 x =
round(x, ROUND_CASES)
83 y =
round(y, ROUND_CASES)
86 colorList.append(
"#ff0000")
90for i
in np.arange(START_LINE, 0, abs(START_LINE) // STRAIGHT_POINTS):
92 y =
round(i, ROUND_CASES)
95 colorList.append(
"#00aa00")
100 for angle
in np.arange(math.pi, -math.pi, -2 * math.pi / circleDivisions):
102 x = CENTER_X + RADIUS * math.cos(angle)
103 y = CENTER_Y + RADIUS * math.sin(angle)
104 x =
round(x, ROUND_CASES)
105 y =
round(y, ROUND_CASES)
108 colorList.append(
"#00aa00")
111 for angle
in np.arange(0, 2 * math.pi, 2 * math.pi / circleDivisions):
113 x = -CENTER_X + RADIUS * math.cos(angle)
114 y = CENTER_Y + RADIUS * math.sin(angle)
115 x =
round(x, ROUND_CASES)
116 y =
round(y, ROUND_CASES)
119 colorList.append(
"#00aa00")
123for i
in np.arange(0, END_LINE + 0.01, END_LINE // STRAIGHT_POINTS):
125 y =
round(i, ROUND_CASES)
128 colorList.append(
"#00aa00")
132for i
in range(len(yCones)):
133 yCones[i], xCones[i] = -xCones[i],
shift(yCones[i])
135for i
in range(len(yPoints)):
136 yPoints[i], xPoints[i] = -xPoints[i],
shift(yPoints[i])
143print(len(yPoints + yCones))
149f1 = open(
"skidpad.txt",
"w")
150f1.write(f
"{1.0} {0.0}\n")
151for i
in range(1, len(xPoints)):
152 f1.write(f
"{xPoints[i]} {yPoints[i]}\n")
156f2 = open(
"skidpad_map.txt",
"w")
157for i
in range(1, len(xCones)):
158 f2.write(f
"{xCones[i]} {yCones[i]}\n")
164plt.scatter(xCones + xPoints, yCones + yPoints, s=2, c=colorList)
double round(double number, int n)
round to n decimal places