Projection | R Documentation |
A projection on a line D
parallel to another line
Delta
is given by the line of projection (D
)
and the directrix line (Delta
).
D
get or set the projection line
Delta
get or set the directrix line
new()
Create a new Projection
object.
Projection$new(D, Delta)
D, Delta
two Line
objects such that the two lines meet
(not parallel); or Delta = NULL
for orthogonal projection onto
D
A new Projection
object.
D <- Line$new(c(1,1), c(5,5)) Delta <- Line$new(c(0,0), c(3,4)) Projection$new(D, Delta)
print()
Show instance of a projection object.
Projection$print(...)
...
ignored
project()
Project a point.
Projection$project(M)
M
a point
D <- Line$new(c(1,1), c(5,5)) Delta <- Line$new(c(0,0), c(3,4)) P <- Projection$new(D, Delta) M <- c(1,3) Mprime <- P$project(M) D$includes(Mprime) # should be TRUE Delta$isParallel(Line$new(M, Mprime)) # should be TRUE
transform()
An alias of project
.
Projection$transform(M)
M
a point
getMatrix()
Augmented matrix of the projection.
Projection$getMatrix()
A 3x3 matrix.
P <- Projection$new(Line$new(c(2,2), c(4,5)), Line$new(c(0,0), c(1,1))) M <- c(1,5) P$project(M) P$getMatrix() %*% c(M,1)
asAffine()
Convert the reference projection to an Affine
object.
Projection$asAffine()
clone()
The objects of this class are cloneable with this method.
Projection$clone(deep = FALSE)
deep
Whether to make a deep clone.
For an orthogonal projection, you can use the projection
method of the Line
R6 class.
## ------------------------------------------------
## Method `Projection$new`
## ------------------------------------------------
D <- Line$new(c(1,1), c(5,5))
Delta <- Line$new(c(0,0), c(3,4))
Projection$new(D, Delta)
## ------------------------------------------------
## Method `Projection$project`
## ------------------------------------------------
D <- Line$new(c(1,1), c(5,5))
Delta <- Line$new(c(0,0), c(3,4))
P <- Projection$new(D, Delta)
M <- c(1,3)
Mprime <- P$project(M)
D$includes(Mprime) # should be TRUE
Delta$isParallel(Line$new(M, Mprime)) # should be TRUE
## ------------------------------------------------
## Method `Projection$getMatrix`
## ------------------------------------------------
P <- Projection$new(Line$new(c(2,2), c(4,5)), Line$new(c(0,0), c(1,1)))
M <- c(1,5)
P$project(M)
P$getMatrix() %*% c(M,1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.