Skip to contents

Applies a rotation defined by azimuth and elevation angles and returns the first two columns of the rotated matrix.

Usage

project.3d(coords, azimuth = 35, elevation = 22)

Arguments

coords

Numeric matrix with at least 3 columns (only the first 3 are used).

azimuth

Rotation around the vertical axis in degrees. Default 35.

elevation

Rotation around the horizontal axis in degrees. Default 22.

Value

A two-column numeric matrix of projected (x, y) coordinates.

Details

This is the projection used internally by plot.layout when projection = "ortho" and is exported so that users can pre-project coordinates for custom plotting.

Examples

edges <- edges.torus(6, 10)
coords3d <- grip(edges, n = max(edges), dim = 3,
                        preset = "torus", seed = 1)
xy <- project.3d(coords3d)
plot(xy, asp = 1, pch = 16, cex = 0.5)