Reflect geometric objects across a reflection axis.
gt_reflect(obj, angle, fid = NULL, update = TRUE)
obj | [ |
---|---|
angle | [ |
fid | [ |
update | [ |
geom
of the reflected obj
.
The reflection axis is a straight line that goes through the plot origin with the given angle, where positive angles open towards the positive y-axis and negative angles open up towards the negative y-axis.
Other geometry tools:
gt_filter()
,
gt_locate()
,
gt_pull()
,
gt_rotate()
,
gt_scale()
,
gt_skew()
,
gt_stretch()
,
gt_translate()
# reflect several features visualise(gtGeoms$polygon, linewidth = 3) newPoly <- gt_reflect(obj = gtGeoms$polygon, angle = 45, update = FALSE) visualise(newPoly, linecol = "green", new = FALSE) # reflect a single feature visualise(gtGeoms$polygon, linewidth = 3) newPoly <- gt_reflect(obj = gtGeoms$polygon, angle = 90, fid = 2, update = FALSE) visualise(newPoly, linecol = "green", new = FALSE)