add docs to scale, rotate
This commit is contained in:
parent
8a584ceab4
commit
e691a42b90
@ -159,10 +159,15 @@ function scale!(shape::Shape, x::Real, y::Real = x, c = center(shape))
|
|||||||
shape
|
shape
|
||||||
end
|
end
|
||||||
|
|
||||||
|
"""
|
||||||
|
scale(shape, x, y = x, c = center(shape))
|
||||||
|
scale!(shape, x, y = x, c = center(shape))
|
||||||
|
|
||||||
|
Scale shape by a factor.
|
||||||
|
"""
|
||||||
scale(shape::Shape, x::Real, y::Real = x, c = center(shape)) =
|
scale(shape::Shape, x::Real, y::Real = x, c = center(shape)) =
|
||||||
scale!(deepcopy(shape), x, y, c)
|
scale!(deepcopy(shape), x, y, c)
|
||||||
|
|
||||||
"translate a Shape in space"
|
|
||||||
function translate!(shape::Shape, x::Real, y::Real = x)
|
function translate!(shape::Shape, x::Real, y::Real = x)
|
||||||
sx, sy = coords(shape)
|
sx, sy = coords(shape)
|
||||||
for i in eachindex(sx)
|
for i in eachindex(sx)
|
||||||
@ -172,6 +177,12 @@ function translate!(shape::Shape, x::Real, y::Real = x)
|
|||||||
shape
|
shape
|
||||||
end
|
end
|
||||||
|
|
||||||
|
"""
|
||||||
|
translate(shape, x, y = x)
|
||||||
|
translate!(shape, x, y = x)
|
||||||
|
|
||||||
|
Translate a Shape in space.
|
||||||
|
"""
|
||||||
translate(shape::Shape, x::Real, y::Real = x) = translate!(deepcopy(shape), x, y)
|
translate(shape::Shape, x::Real, y::Real = x) = translate!(deepcopy(shape), x, y)
|
||||||
|
|
||||||
rotate_x(x::Real, y::Real, θ::Real, centerx::Real, centery::Real) =
|
rotate_x(x::Real, y::Real, θ::Real, centerx::Real, centery::Real) =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user