Skip to content

Commit

Permalink
Fix scaling factor: shouldn't be sqrt
Browse files Browse the repository at this point in the history
  • Loading branch information
nikochiko committed Jan 16, 2024
1 parent 6a9209d commit ee59e4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/transform.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ let rec translate dx dy shape =
| Complex shapes -> Complex (List.map (translate dx dy) shapes)

let rec scale factor s =
let scale_length fact len = len *. sqrt fact in
let scale_point fact pt = pt *! sqrt fact in
let scale_length fact len = len *. fact in
let scale_point fact pt = pt *! fact in
match s with
| Circle circle' ->
Circle { c = scale_point factor circle'.c; radius = scale_length factor circle'.radius }
Expand Down

0 comments on commit ee59e4e

Please sign in to comment.