Learn R Programming

affiner (version 0.2.1)

is_equivalent: Test whether two objects are equivalent

Description

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 angle is_equivalent( x, y, ..., mod_turns = TRUE, tolerance = sqrt(.Machine$double.eps) )

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

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

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

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

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

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

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

Value

A logical vector

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”.

See Also

is_congruent(), all.equal()

Examples

Run this code
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)

Run the code above in your browser using DataLab