Skip to contents

Geometries can be ill-defined for several reasons, e.g. circles with a radius of zero, segments that start and end at the same location, etc. See details for a list of conditions that are considered degenerate.

Usage

is_degenerate(x)

Arguments

x

A geometry vector

Value

A logical vector

Details

The following conditions are considered to produce degenerate geometries:

  • A circle having a radius of zero

  • An iso-rectangle with zero width or zero height

  • An iso-cuboid with zero width, zero height, or zero depth

  • A 2D line with the coefficients being zero

  • A 3D line that is degenerated to a point

  • A plane with the coefficients being zero

  • A ray with the source and the second defining point being equal

  • A segment with the source and target being equal

  • A sphere with a radius of zero

  • A tetrahedron with all vertices being co-planar

  • A triangle with collinear vertices

Examples

# A line without direction
l <- line(point(0, 5), vec(0, 0))
is_degenerate(l)
#> [1] TRUE

# A circle without radius
circ <- circle(point(3, -1), 0)
is_degenerate(circ)
#> [1] TRUE