Learn R Programming

RConics (version 1.1.2)

intersectConicConic: Intersection between two conics

Description

Returns the point(s) of intersection between two conics in homogeneous coordinates.

Usage

intersectConicConic(C1, C2)

Value

The homogeneous coordinates of the intersection points. If there are \(k\) points of intersection, it returns a \((3 \times k)\)

matrix whose columns correspond to the homogeneous coordinates of the intersection points. If there is only one point, a \((3 \times 1)\) vector of the homogeneous coordinates of the intersection point is returned. If there is no intersection, NULL is returned.

Arguments

C1

\((3 \times 3)\) matrix representation of conics.

C2

\((3 \times 3)\) matrix representation of conics.

Examples

Run this code
# Ellipse with semi-axes a=8, b=2, centered in (0,0), with orientation angle = -pi/3
C1 <- ellipseToConicMatrix(c(8,2), c(0,0), -pi/3)

# Ellipse with semi-axes a=5, b=2, centered in (1,-2), with orientation angle = pi/5
C2 <- ellipseToConicMatrix(c(5,2), c(1,-2), pi/5)

# intersection conic C with conic C2
p_CC2 <- intersectConicConic(C1,C2)

# plot
plot(ellipse(c(8,2), c(0,0), -pi/3),type="l",asp=1)
lines(ellipse(c(5,2), c(1,-2), pi/5), col="blue")
points(t(p_CC2), pch=20,col="blue")

Run the code above in your browser using DataLab