mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 22:04:56 +00:00
12 lines
378 B
Python
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})"
|