Skip to content

Add rotation examples for transform#392

Open
Maximus-08 wants to merge 1 commit intoJuliaGeo:mainfrom
Maximus-08:docs-transform-rotation-examples
Open

Add rotation examples for transform#392
Maximus-08 wants to merge 1 commit intoJuliaGeo:mainfrom
Maximus-08:docs-transform-rotation-examples

Conversation

@Maximus-08
Copy link

Summary

This PR expands the transform documentation with rotation examples and adds test coverage for those workflows.

Changes

  • add CoordinateTransformations.LinearMap examples for rotating polygons
  • document rotation around both the origin and a polygon centroid
  • add transform tests covering:
    • rotation around the origin
    • rotation around the centroid while preserving centroid and area
  • add a tutorial example in creating_geometry.md showing both rotation approaches visually

Fixes: #192

All tests passed locally

Signed-off-by: Avnish Jaltare <avnishjaltare8@gmail.com>
Copilot AI review requested due to automatic review settings March 18, 2026 11:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds documentation and tests demonstrating that GO.transform accepts callable CoordinateTransformations.jl transforms (notably LinearMap-based rotations), including examples for rotating about the origin and about a polygon’s centroid.

Changes:

  • Added new transformation tests covering polygon rotation around the origin and around the centroid (centroid/area invariants).
  • Expanded transform docstring with CoordinateTransformations.jl LinearMap rotation examples.
  • Extended the “creating geometry” tutorial with rotation examples and visualization.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
test/transformations/transform.jl Adds rotation-focused testsets for GO.transform, including centroid/area assertions.
src/transformations/transform.jl Updates transform documentation to explicitly mention callable transforms and shows LinearMap usage.
docs/src/tutorials/creating_geometry.md Adds tutorial content demonstrating rotation about origin vs centroid using composed transforms.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +116 to +117
We can also rotate a polygon with the same `transform` function. A `LinearMap`
rotates around the origin.
@Maximus-08
Copy link
Author

Hey @asinghvi17 Please take a look when you're free, the failed check does not seem related to changes

@asinghvi17
Copy link
Member

Thanks for the PR! I think LinearMap is a bit too complex to be in a beginner tutorial. Would you mind changing this to use something from Rotations.jl instead?

2 similar comments
@asinghvi17

This comment was marked as duplicate.

@asinghvi17

This comment was marked as duplicate.

@Maximus-08
Copy link
Author

Sure I will take a look at Rotations.jl and confirm the approach with you

@Maximus-08
Copy link
Author

Hey would RotMatrix be a good option, we could use Angle2d but it can only be applied to 2D .

@asinghvi17
Copy link
Member

I would recommend Angle2D. 99% of users here will be performing 2D operations, so that's what is relevant to them.

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.

Quick way of rotating a polygon?

3 participants