Files
2026-03-09 22:30:41 +00:00

12 lines
378 B
Python

import math
class Pin:
def __init__(self, name, comp_at, dx, dy, rotation=0):
r = math.radians(rotation)
self.name = name
self.x = comp_at[0] + (dx * math.cos(r) - dy * math.sin(r))
self.y = comp_at[1] + (dx * math.sin(r) + dy * math.cos(r))
def __repr__(self):
return f"Pin(name={self.name!r}, x={self.x:.3f}, y={self.y:.3f})"