fix botched use of "sqrt" instead of "math.sqrt"
rotate around image center, not corner
make line segments shorter
fix scaling issue