polar: Polar line of point with respect to a conic

Description Usage Arguments Details Value References Examples

View source: R/RConics.R

Description

Return the polar line l of a point p with respect to a conic with matrix representation C. The polar line l is defined by l = Cp.

Usage

1
polar(p, C)

Arguments

p

a (3 \times 1) vector of the homogeneous coordinates of a point.

C

a (3 \times 3) matrix representation of the conic.

Details

The polar line of a point p on a conic is tangent to the conic on p.

Value

A (3 \times 1) vector of the homogeneous representation of the polar line.

References

Richter-Gebert, J<c3><bc>rgen (2011). Perspectives on Projective Geometry - A Guided Tour Through Real and Complex Geometry, Springer, Berlin, ISBN: 978-3-642-17285-4

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  # Ellipse with semi-axes a=5, b=2, centered in (1,-2), with orientation angle = pi/5
  C <- ellipseToConicMatrix(c(5,2),c(1,-2),pi/5)
  
  # line
  l <- c(0.25,0.85,-1)
  
  # intersection conic C with line l:
  p_Cl <- intersectConicLine(C,l)
  
  # if p is on the conic, the polar line is tangent to the conic
  l_p <- polar(p_Cl[,1],C)
  
  # point outside the conic
  p1 <- c(5,-3,1)
  l_p1 <- polar(p1,C)
  
  # point inside the conic
  p2 <- c(-1,-4,1)
  l_p2 <- polar(p2,C)
  
  # plot
  plot(ellipse(c(5,2),c(1,-2),pi/5),type="l",asp=1, ylim=c(-10,2))
  # addLine(l,col="red")
  points(t(p_Cl[,1]), pch=20,col="red")
  addLine(l_p,col="red")
  points(t(p1), pch=20,col="blue")
  addLine(l_p1,col="blue")
  points(t(p2), pch=20,col="green")
  addLine(l_p2,col="green")
  
  # DUAL CONICS
  saxes <- c(5,2)
  theta <- pi/7
  E <- ellipse(saxes,theta=theta, n=50)
  C <-  ellipseToConicMatrix(saxes,c(0,0),theta)
  plot(E,type="n",xlab="x", ylab="y", asp=1)
  points(E,pch=20)
  E <- rbind(t(E),rep(1,nrow(E)))
  
  All_tangant <- polar(E,C)
  apply(All_tangant, 2, addLine, col="blue")
  

RConics documentation built on May 30, 2017, 5:22 a.m.