Skip to contents

If two geometries are parallel they have the same orientation. euclid allows assessing parallelity of a broad range of geometries. If x and y are surfaces the parallelity of their supporting plane is returned. If x and y are curves, the parallelity of their supporting line is returned. If it is a mix of surface and curve, the parallelity is calculated as whether the supporting plane and supporting line intersects at a point.

Usage

parallel(x, y)

Arguments

x, y

vectors of geometries

Value

a logical vector giving the parallelity of the input

Examples

# Are two triangles parallel (only meaningful in 3D)
p <- point(sample(20, 6), sample(20, 6), sample(20, 6))
t1 <- triangle(p[1], p[2], p[3])
t2 <- triangle(p[4], p[5], p[6])

parallel(t1, t2)
#> [1] FALSE

# Same as:
parallel(as_plane(t1), as_plane(t2))
#> [1] FALSE

# Parallelity of surface and curve
parallel(t1, line(p[5], p[6]))
#> [1] FALSE