Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graphics2d: scale now modifies a translation within a picture #40

Merged
merged 2 commits into from
Oct 13, 2024

Conversation

paulcadman
Copy link
Owner

The scale op now modifies a translation op within a picture.

NB translation and scaling are not commutative:

  1. scaling a translated picture
    .circle r |> .translate t |> .scale s

results in a circle centered at t.dot s

  1. translating a scaled picture
   .circle r |> .scale s |> translate t

results in a circle centered at t

The window and orbital examples are updated to demo this change.

This PR also adds a smoothing parameter to the orbit update function to prevent orbiting bodies flying to infinity.

NB translation and scaling are not commutative:

1. scaling a translated picture

    .circle r |> .translate t |> .scale s

results in a circle centered at `t.dot s`

2. translating a scaled picture

   .circle r |> .scale s |> translate t

results in a circle centered at `t`

The window and orbital examples are updated to demo this change
@paulcadman paulcadman merged commit 0f27395 into main Oct 13, 2024
2 checks passed
@paulcadman paulcadman deleted the orbital-improvement branch October 13, 2024 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant