Draw ticks on clock
(self)
| 179 | self.new() |
| 180 | |
| 181 | def new(self): |
| 182 | """ |
| 183 | Draw ticks on clock |
| 184 | """ |
| 185 | (x, y, start_radius, stop_radius, start_angle, stop_angle, step, |
| 186 | line_color, line_width) = self.all |
| 187 | start_angle, stop_angle = (180 - start_angle, 180 - stop_angle |
| 188 | ) if stop_angle < start_angle else (180 - stop_angle, 180 - start_angle) |
| 189 | for i in range(start_angle, stop_angle + 1, step): |
| 190 | start_x = x + start_radius * math.cos(i / 180 * math.pi) |
| 191 | start_y = y + start_radius * math.sin(i / 180 * math.pi) |
| 192 | stop_x = x + stop_radius * math.cos(i / 180 * math.pi) |
| 193 | stop_y = y + stop_radius * math.sin(i / 180 * math.pi) |
| 194 | self.figure.append(self.graph_elem.DrawLine((start_x, start_y), |
| 195 | (stop_x, stop_y), color=line_color, width=line_width)) |
| 196 | |
| 197 | def move(self, delta_x, delta_y): |
| 198 | """ |