Skip to contents

is_equivalent() is a S3 generic that tests whether two different objects are “equivalent”. The is_equivalent() method for angle() classes tests whether two angles are congruent. The is_equivalent() method for Point1D, Line2D, Plane3D classes tests whether they are the same point/line/plane after standardization.

Usage

is_equivalent(x, y, ...)

# S3 method for class 'angle'
is_equivalent(
  x,
  y,
  ...,
  mod_turns = TRUE,
  tolerance = sqrt(.Machine$double.eps)
)

# S3 method for class 'numeric'
is_equivalent(x, y, ..., tolerance = sqrt(.Machine$double.eps))

# S3 method for class 'Coord1D'
is_equivalent(x, y, ..., tolerance = sqrt(.Machine$double.eps))

# S3 method for class 'Coord2D'
is_equivalent(x, y, ..., tolerance = sqrt(.Machine$double.eps))

# S3 method for class 'Coord3D'
is_equivalent(x, y, ..., tolerance = sqrt(.Machine$double.eps))

# S3 method for class 'Point1D'
is_equivalent(x, y, ..., tolerance = sqrt(.Machine$double.eps))

# S3 method for class 'Line2D'
is_equivalent(x, y, ..., tolerance = sqrt(.Machine$double.eps))

# S3 method for class 'Plane3D'
is_equivalent(x, y, ..., tolerance = sqrt(.Machine$double.eps))

Arguments

x, y

Two objects to test whether they are “"equivalent"”.

...

Further arguments passed to or from other methods.

mod_turns

If TRUE angles that are congruent modulo full turns will be considered “congruent”.

tolerance

Numerics with differences smaller than tolerance will be considered “equivalent”.

Value

A logical vector

Examples

line1 <- as_line2d(a = 1, b = 2, c = 3) # 1 * x + 2 * y + 3 = 0
line2 <- as_line2d(a = 2, b = 4, c = 6) # 2 * x + 4 * y + 6 = 0
is_equivalent(line1, line2)
#> [1] TRUE