hyperplane: Hyperplane Passing Through k Points in the k-dimensional...

Description Usage Arguments Details Value Author(s) Examples

Description

The function computes a (k-1)-dimensional hyperplane passing through k given points in the k-dimensional space.

Usage

1

Arguments

X

a numeric k x k matrix containing k data points as rows.

Details

A (k-1)-dimensional hyperplane in R^k consists of all points x that satisfy

d' x + c = 0,

where d is a k-vector and c is a scalar. The function returns the (k+1)-vector (d,c). It is normalized such that the length of d equals (k-1)! times the (k-1)-dimensional volume of the simplex formed by the points on the plane. (If k = 3, this is a triangle.) Hence this function can also easily be used to compute volumes of simplices.

The direction of d, that is, whether it points towards the origin or not, is not fixed. It depends on the order of the data points within the matrix X.

If the k points do not uniquely define a (k-1)-dimensional hyperplane (i.e. they lie on a (k-2)-dimensional hyperplane), a vector containing zeros is returned.

Value

a vector of length (k-1) describing the hyperplane, see details above.

Author(s)

Daniel Vogel

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
### ----<< Example 1 >>---- : line in R^2
X <- rbind(c(4,5),c(8,2))
hyperplane(X)
# The line through the the points c(4,5) and c(8,2) is given by 
#    3*x + 4*y - 32 = 0.
# The norm of the first two components of the return value 
# of hyperplane() (i.e. the vector d above) equals the 
# distance of both points.

X <- rbind(c(8,2),c(4,5))
hyperplane(X)
# If the order of the points is changed, the direction of d 
# (see details) may also change.



### ----<< Example 2 >>---- : unit vectors in R^3
X <- diag(rep(1,3))
hyperplane(X)
# The plane passing through all three unit vectors is given by 
#   -x - y - z + 1 = 0.
# These three points form a equilateral triangle on the plane 
# with side length sqrt(2) and hence area sqrt(3)/2.
# The norm of d (see details) equals twice this number. 

Example output

Loading required package: ICS
Loading required package: mvtnorm
Loading required package: ICSNP
[1]   3   4 -32
[1] -3 -4 32
[1] -1 -1 -1  1

OjaNP documentation built on Feb. 23, 2020, 5:07 p.m.