Learn R Programming

conics (version 0.3)

conicCenter: Center of a conic

Description

Find the center of a conic.

Usage

conicCenter(x)

Arguments

x
a 6-length vector or a symmetric 3x3 matrix

Value

A two-elements vector containing the coordinates of the center. If the conic has no center the function raises an error.

Details

The conicCenter function calculates the coordinates of the center of a conic specified by its coefficients or by its symmetric matrix.

See Also

conicAsymptotes, conicAxes, conicMatrix, conicPlot

Examples

Run this code
# Ellipse
# Equation: 2*x_1^2 + 2*x_1*x_2 + 2*x_2^2 - 20*x_1 - 28*x_2 + 10 = 0
v <- c(2,2,2,-20,-28,10)
conicCenter(v)

# Hyperbola
# Equation: 2*x_1^2 + 2*x_1*x_2 - 2*x_2^2 - 20*x_1 + 20*x_2 + 10 = 0
v <- c(2,2,-2,-20,20,10)
conicCenter(v)

Run the code above in your browser using DataLab