Learn R Programming

affiner (version 0.2.1)

is_parallel: Whether two objects are parallel

Description

is_parallel() is a S3 method that tests whether two objects are parallel.

Usage

is_parallel(x, y, ...)

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

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

Value

A logical vector.

Arguments

x, y

The two objects to compute if they are parallel.

...

Passed to other methods (or ignored).

tolerance

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

Examples

Run this code
line1 <- as_line2d("x-axis")
line2 <- as_line2d("y-axis")
line3 <- as_line2d(a = 0, b = 1, c = 2) # y + 2 = 0
is_parallel(line1, line1)
is_parallel(line1, line2)
is_parallel(line1, line3)

Run the code above in your browser using DataLab