Skip to content

Instantly share code, notes, and snippets.

@buzzsawddog
buzzsawddog / convert.py
Created February 22, 2026 22:00
Convert Apophysis triangle to Chaotica affine
#!/usr/bin/env python3
import math
from typing import Tuple, Dict
def vector_to_length_angle(dx: float, dy: float) -> Tuple[float, float]:
"""
Convert a vector (dx, dy) to (length, angle_in_degrees).
"""
length = math.hypot(dx, dy)