Skip to contents

{grid} affine transformation utilities

Utilities to use the {grid} group affine transformation feature

affineGrob() grid.affine()
Affine transformation grob
affine_settings()
Compute grid affine transformation feature viewports and transformation functions
isocubeGrob() grid.isocube()
Isometric cube grob

1D/2D/3D coordinate objects

1D/2D/3D coordinate objects

Coord1D
1D coordinate vector R6 Class
is_coord1d()
Test whether an object has a Coord1D class
as_coord1d()
Cast to coord1d object
Coord2D
2D coordinate vector R6 Class
is_coord2d()
Test whether an object has a Coord2D class
as_coord2d()
Cast to coord2d object
Coord3D
3D coordinate vector R6 Class
is_coord3d()
Test whether an object has a Coord3D class
as_coord3d()
Cast to coord3d object

1D points, 2D lines, and 3D planes

1D points, 2D line, and 3D plane objects

Point1D
1D points R6 Class
as_point1d()
Cast to Point1D object
is_point1d()
Test whether an object has a Point1D class
Line2D
2D lines R6 Class
as_line2d()
Cast to Line2D object
is_line2d()
Test whether an object has a Line2D class
Plane3D
3D planes R6 Class
as_plane3d()
Cast to Plane3D object
is_plane3d()
Test whether an object has a Plane3D class

1D/2D/3D affine transformation matrices

1D/2D/3D affine transformation matrices

transform1d() project1d() reflect1d() scale1d() translate1d()
1D affine transformation matrices
is_transform1d()
Test if 1D affine transformation matrix
as_transform1d()
Cast to 1D affine transformation matrix
transform2d() permute2d() project2d() reflect2d() rotate2d() scale2d() shear2d() translate2d()
2D affine transformation matrices
is_transform2d()
Test if 2D affine transformation matrix
as_transform2d()
Cast to 2D affine transformation matrix
transform3d() permute3d() project3d() reflect3d() rotate3d() scale3d() shear3d() translate3d()
3D affine transformation matrices
is_transform3d()
Test if 3D affine transformation matrix
as_transform3d()
Cast to 3D affine transformation matrix
rotate3d_to_AA()
Convert from 3D rotation matrix to axis-angle representation.

Angle vectors

Angle vectors allow users to use whichever angular unit is most convenient for them

angle() degrees() gradians() pi_radians() radians() turns()
Angle vectors
is_angle()
Test whether an object is an angle vector
as_angle()
Cast to angle vector
angular_unit() `angular_unit<-`()
Get/set angular unit of angle vectors
is_congruent()
Test whether two objects are congruent
sine() cosine() tangent() secant() cosecant() cotangent()
Angle vector aware trigonometric functions
arcsine() arccosine() arctangent() arcsecant() arccosecant() arccotangent()
Angle vector aware inverse trigonometric functions
as.double(<angle>) as.complex(<angle>) format(<angle>) print(<angle>) abs(<angle>)
Implemented base methods for angle vectors

Additional coordinate calculations

Compute centroids, Euclidean norms, axis-aligned ranges, convex hulls, cross products, and vector normals

mean(<Coord1D>) mean(<Coord2D>) mean(<Coord3D>)
Compute centroids of coordinates
abs(<Coord1D>) abs(<Coord2D>) abs(<Coord3D>)
Compute Euclidean norm
range(<Coord1D>) range(<Coord2D>) range(<Coord3D>)
Compute axis-aligned ranges
convex_hull2d()
Compute 2D convex hulls
cross_product3d()
Compute 3D vector cross product
distance1d()
1D Euclidean distances
distance2d()
2D Euclidean distances
distance3d()
3D Euclidean distances
normal2d()
2D normal vectors
normal3d()
3D normal vectors
plot(<Coord1D>) points(<Coord1D>) lines(<Point1D>) plot(<Coord2D>) points(<Coord2D>) lines(<Line2D>)
Plot coordinates, points, lines, and planes

Package options

Package global options

affiner_options()
Get affiner options
affiner affiner-package
affiner: A Finer Way to Render 3D Illustrated Objects in 'grid' Using Affine Transformations