Skip to content

Commit

Permalink
tidy rotatepoint changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cormullion committed Dec 11, 2022
1 parent 8559c05 commit 33c2aad
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 23 deletions.
10 changes: 6 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# Changelog

## [v3.6.0] - 2022-12-1?
## [v3.6.0] - 2022-12-11

LaTeX support is still under development.
See https://github.com/JuliaGraphics/Cairo.jl/pull/357.

### Added

- the `Base.show(f::IO, ::MIME"image/svg+xml")` method that displays SVGs in notebooks modifies the glyph ids to avoid the familiar "Jupyter cells leak" problem
- `polyclip()` clips one poly with another
- `ispointonleftonline()` used by ↑
- `bezigon()`
- the `Base.show(f::IO, ::MIME"image/svg+xml")` method that displays SVGs in notebooks modifies the glyph ids to avoid the familiar "Jupyter cells leak" problem (described [here](https://github.com/MakieOrg/Makie.jl/issues/952#issuecomment-842413678))
- `polyclip()` clips one poly with another convex polygon
- `ispointonleftonline()` used by ↑
- `rotatepoint()` is better name for `rotate_point_around_point()` (thanks @gantz-giraffe !)

### Changed

Expand All @@ -24,6 +25,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357.

### Deprecated

- `rotate_point_around_point()` is now `rotatepoint()`
# ────────────────────────────────────────────────────────────────────────────────────

## [v3.5.0] - 2022-07-28 10:15
Expand Down
32 changes: 17 additions & 15 deletions docs/src/howto/geometrytools.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,35 +173,37 @@ nothing # hide

![angle three points](../assets/figures/anglethreepoints.png)

Functions that help with geometry include:
Other functions that help with geometry include:

- [`distance`](@ref)
- [`distance`](@ref) distance between two points

- [`getnearestpointonline`](@ref)
- [`getnearestpointonline`](@ref) drop perpendicular

- [`pointlinedistance`](@ref)
- [`pointlinedistance`](@ref) distance of point from line between two points

- [`slope`](@ref)
- [`slope`](@ref) angle of line between two points

- [`perpendicular`](@ref)
- [`perpendicular`](@ref) find perpendicular

- [`dotproduct`](@ref)
- [`dotproduct`](@ref) scalar dot product of two points

- [`@polar`](@ref)
- [`@polar`](@ref) convert radius and angle to point

- [`polar`](@ref)
- [`polar`](@ref) convert radius and angle to point

- [`ispointonline`](@ref)
- [`ispointonline`](@ref) true if point lies on line

- [`ispointonpoly`](@ref)
- [`ispointonpoly`](@ref) true if point lies on any edge of polygon

- [`isarcclockwise`](@ref)
- [`isarcclockwise`](@ref) true if arc is clockwise

- [`pointinverse`](@ref)
- [`pointinverse`](@ref) inverse of point with respect to circle

- [`anglethreepoints`](@ref)
- [`anglethreepoints`](@ref) angle formed by two lines defined by three points

- [`determinant3`](@ref)
- [`determinant3`](@ref) find determinant of matrix of 3 points

- [`rotatepoint`](@ref) rotate point around another by angle

## Triangle centers

Expand Down
2 changes: 2 additions & 0 deletions src/deprecations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ using Base: @deprecate
@deprecate intersection(pt1::Point, pt2::Point, pt3::Point, pt4::Point) intersectionlines(pt1::Point, pt2::Point, pt3::Point, pt4::Point)

@deprecate polytriangulate!(pt) polytriangulate(pt)

@deprecate rotate_point_around_point(targetpt, pt, angle) rotatepoint(targetpt, pt, angle)
12 changes: 8 additions & 4 deletions src/point.jl
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,7 @@ end
rotatepoint(targetpt::Point, originpt::Point, angle)
Rotate a target point around another point by an angle specified in radians.
Returns the new point.
"""
function rotatepoint(targetpt::Point, originpt::Point, angle)
Expand All @@ -622,13 +623,16 @@ function rotatepoint(targetpt::Point, originpt::Point, angle)
y2 = x1 * sin(angle) + y1 * cos(angle)
return Point(x2 + originpt.x, y2 + originpt.y)
end

"""
rotatepoint(targetpt::Point, angle)
Rotate a target point around canvas origin by an angle specified in radians.
rotatepoint(targetpt::Point, angle)
Rotate a target point around the current origin by an angle specified in radians.
Returns the new point.
"""
rotatepoint(targetpt::Point, angle) = rotatepoint(targetpt,O,angle)
rotatepoint(targetpt::Point, angle) = rotatepoint(targetpt, O, angle)

"""
ispointonleftofline(A::Point, B::Point, C::Point)
Expand Down

0 comments on commit 33c2aad

Please sign in to comment.