<<

geometer Documentation Release 0.2.3

Jan Müller

Jul 08, 2020

Contents:

1 Installation 3 1.1 Quickstart...... 3 1.2 API Reference...... 5 1.3 Changelog...... 30

2 Indices and tables 33 2.1 References...... 33

Python Module Index 35

Index 37

i ii geometer Documentation, Release 0.2.3

Geometer is a library for Python 3 that uses and numpy for fast geometric computa- tion. In projective geometry every in 2D is represented by a three-dimensional vector and every point in 3D is represented by a four-dimensional vector. This has the following advantages: • There are points at infinity that can be treated just like points. • Projective transformations are described by matrices but they can also represent affine transformations i.e. also translations. • Every two lines have a unique point of if they lie in the same . lines have a point of intersection at infinity. • Points of intersection, planes or lines through given points can be calculated using simple cross products or tensor diagrams. • Special complex points at infinity and cross ratios can be used to calculate and to construct geometric structures. Most of the computation in the library done via tensor diagrams (using numpy.einsum). The source code of the package can be found on GitHub and the documentation on Read the Docs.

Contents: 1 geometer Documentation, Release 0.2.3

2 Contents: CHAPTER 1

Installation

You can install the package directly from PyPI: pip install geometer

1.1 Quickstart

1.1.1 Geometry in Two

The elementary objects of projective geometry, points and lines can be created using the Point and classes without having to specify the : from geometer import * p= Point(2,4) q= Point(3,5) l= Line(p, q) m= Line(0,1,0)

Here we specified a line once by two points and once using the homogeneous coordinates of the line. The two elementary operations meet and join can also be called called exactly as one would expect: l= join(p, q) r= meet(l, m)

Geometer can also construct parallel and perpendicular lines: m=l.parallel(through=Point(1,1)) n=l.perpendicular(through=Point(1,1)) is_perpendicular(m, n)

The function is_perpendicular() returns True when two lines are perpendicular. Other angles an can also be calculated:

3 geometer Documentation, Release 0.2.3

a= (l, Point(1,0)) dist(l, p) import numpy as np p+2 *dist(p, q)*Point(np.cos(a), np.sin(a))

Projective transformations can be easily created using the methods and translation or by supplying a to the Transformation class: t1= translation(0,-1) t2= rotation(-np.pi) t3= Transformation([[0,1,0], [1,0,0], [0,0,1]]) t1*t2*p

Geometer also includes tools to work with conics. They can be created using the classes Conic or : a= Point(-1,0) b= Point(0,3) c= Point(1,2) d= Point(2,1) e= Point(0,-1) conic= Conic.from_points(a, b, c, d, e)

To calculate cross ratios of points or lines, the function crossratio() can be used: t= rotation(np.pi/16) crossratio(q, t*q, t**2 * q, t**3 * q, p)

Other interesting operators are harmonic_set(), angle_bisectors(), is_cocircular() and is_collinear().

1.1.2 Geometry in Three Dimensions

Creating points and lines in 3D works the same as in the two dimensional case: p1= Point(1,1,0) p2= Point(2,1,0) p3= Point(3,4,0) l= Line(p1, p2)

In addition to points and lines, in three dimensions we can use the Plane class or the join operation to create planes:

A= join(l, p3) A.project(Point(3,4,5))

Points can be projected onto planes and lines. The result is still a point in 3D but now lying on the plane. The point of intersection of a plane and a line can be calculated with the meet operation: l= Line(Point(1,2,3), Point(3,4,5)) A.meet(l)

All other operations such as angles, distances, perpendicular lines, cross ratios are also compatible with objects in 3D. For information on their usage, you can look at the two dimensional example.

4 Chapter 1. Installation geometer Documentation, Release 0.2.3

1.2 API Reference

1.2.1 geometer package geometer.utils package geometer.utils.math.adjugate(A) Calculates the adjugate matrix of A. The resulting matrix is defined by

푖+푗 adj(퐴)푖푗 = (−1) 푀푗푖,

where 푀푗푖 is the of the submatrix of 퐴 obtained by deleting the j-th row and the i-th column of 퐴. For small matrices, this function uses the following formula (Einstein notation): 1 adj(퐴) = 휀 휀 퐴 . . . 퐴 푖푗 (푛 − 1)! 푖 푖2...푖푛 푗 푗2...푗푛 푗2푖2 푗푛푖푛

Source (German): https://de.wikipedia.org/wiki/Levi-Civita-Symbol#Zusammenhang_mit_der_Determinante ParametersA ((. . . , M, M) array_like) – The input matrix. Returns The adjugate of A. Return type (.., M, M) numpy.ndarray geometer.utils.math.det(A) Computes the determinant of A. ParametersA ((. . . , M, M) array_like) – The input matrix. Returns The determinant of A. Return type (..) array_like geometer.utils.math.hat_matrix(*args) Builds a skew symmetric matrix with the given scalars in the positions shown below.

⎛ 0 푐 −푏⎞ ⎝−푐 0 푎 ⎠ 푏 −푎 0

Parameters a, b, c (float) – The scalars to use in the matrix. Returns The resulting antisymmetric matrix. Return type numpy.ndarray geometer.utils.math.is_multiple(a, b, axis=None, rtol=1e-15, atol=1e-08) Returns a boolean array where two arrays are multiples of each other along a given axis. This function compares the absolute value of the scalar product and the product of the norm of the arrays (along an axis). The Cauchy-Schwarz inequality guarantees in its edge case that this equality holds if and only if one of the vectors is a scalar multiple of the other. For documentation of the tolerance parameters see numpy.isclose(). Parameters • a, b (array_like) – Input arrays to compare.

1.2. API Reference 5 geometer Documentation, Release 0.2.3

• axis (None or int or tuple of ints, optional) – The axis or axes along which the two arrays are compared. The default axis=None will compare the whole arrays and return only a single boolean value. • rtol (float, optional) – The relative tolerance parameter. • atol (float, optional) – The absolute tolerance parameter. Returns Returns a boolean array of where along the given axis the arrays are a scalar multiple of each other (within the given tolerance). If no axis is given, returns a single boolean value. Return type array_like geometer.utils.math.null_space(A, dim=None) Constructs an orthonormal basis for the null of a A using SVD. Parameters • A ((. . . , M, N) array_like) – The input matrix. • dim (int or None, optional) – The dimension of the null space if previously known. Returns Orthonormal basis for the null space of A (as column vectors in the returned matrix). Return type (.., N, K) numpy.ndarray geometer.utils.math.orth(A, dim=None) Constructs an orthonormal basis for the range of A using SVD. Parameters • A ((. . . , M, N) array_like) – The input matrix. • dim (int or None, optional) – The dimension of the image space if previously known. Returns Orthonormal basis for the range of A (as column vectors in the returned matrix). Return type (.., M, K) numpy.ndarray geometer.utils.polynomial.np_array_to_poly(c, symbols) Converts an array of coefficients into a polynomial. Deprecated since version 0.2.1: np_array_to_poly will be removed in geometer 0.3.

If c an array of (푚, . . . , 푚) and variables 푥1, . . . , 푥푛 are given as symbols, the resulting polynomial will be given by

∑︁ 푖1 푖푛 푐[푖1, . . . , 푖푛]푥1 ··· 푥푛 . 0≤푖1,...,푖푛≤푚−1

Parameters • c (array_like) – Array of coefficients where the different axis correspond to different vari- ables with the degree in each axis given by the corresponding index. • symbols (list of sympy.Symbol) – The symbols to be used as variables of the polynomial. Returns The resulting polynomial as described above. Return type sympy.Poly geometer.utils.polynomial.poly_to_np_array(p, symbols) Convert a sympy polynomial to an array of coefficients as required by numpy. Deprecated since version 0.2.1: poly_to_np_array will be removed in geometer 0.3.

6 Chapter 1. Installation geometer Documentation, Release 0.2.3

If p is a multivariate polynomial with the variables 푥1, . . . , 푥푛 specified in symbols, the resulting array will be such that

∑︁ 푖1 푖푛 푝 = 푐[푖1, . . . , 푖푛]푥1 ··· 푥푛 . 0≤푖1,...,푖푛≤푚−1

Parameters • p (sympy.Expr) – The sympy expression that represents the polynomial. • symbols (list of sympy.Symbol) – The variables used in the polynomial expression. Returns The coefficients of the polynomial as described above. Return type numpy.ndarray geometer.utils.polynomial.polyval(x, c) Evaluate a multivariate polynomial at a specified point. Deprecated since version 0.2.1: polyval will be removed in geometer 0.3. If x is an array of 푛 and c an array of shape (푚, . . . , 푚), the result is

∑︁ 푖1 푖푛 푐[푖1, . . . , 푖푛]푥[1] ··· 푥[푛] .

0≤푖1,...,푖푛≤푚−1

Parameters • x (array_like) – The point to evaluate the polynomial at. • c (array_like) – Array of coefficients where the different axis correspond to different vari- ables with the degree in each axis given by the corresponding index. Returns The result of the evaluation as described above. Return type float or complex geometer.base module class geometer.base.KroneckerDelta(n, p=1) Bases: geometer.base.Tensor This class can be used to construct a (p, p)-tensor representing the Kronecker delta tensor. The following generalized definition of the Kronecker delta is used: ⎧ +1 if (휈 , . . . , 휈 ) are an even permutation of (휇 , . . . , 휇 ) ⎨⎪ 1 푝 1 푝 훿휇1...휇푝 = 휈1...휈푝 −1 if (휈1, . . . , 휈푝) are an odd permutation of (휇1, . . . , 휇푝) ⎩⎪0 else

Parameters • n (int) – The dimension of the tensor. • p (int, optional) – The number of covariant and contravariant indices of the tensor, default is 1.

1.2. API Reference 7 geometer Documentation, Release 0.2.3

References class geometer.base.LeviCivitaTensor(size, covariant=True) Bases: geometer.base.Tensor This class can be used to construct a tensor representing the Levi-Civita symbol. The Levi-Civita symbol is also called 휀-Tensor and is defined as follows: ⎧ +1 if (휈 , . . . , 휈 ) are an even permutation of (1, . . . , 푛) ⎨⎪ 1 푛 휀휈1...휈푛 = −1 if (휈1, . . . , 휈푛) are an odd permutation of (1, . . . , 푛) ⎩⎪0 else

Parameters • size (int) – The number of indices of the tensor. • covariant (bool, optional) – If true, the tensor will only have covariant indices. Default: True

References class geometer.base.ProjectiveElement(*args, covariant=True, **kwargs) Bases: geometer.base.Tensor, abc.ABC Base class for all projective tensors, i.e. all objects that identify scalar multiples. dim The ambient dimension of the tensor. Type int class geometer.base.Tensor(*args, covariant=True, **kwargs) Bases: object Wrapper class around a numpy array that keeps track of covariant and contravariant indices. Covariant indices are the lower indices (subscripts) and contravariant indices are the upper indices (superscripts) of a tensor (see [1]). Parameters • *args – Either a single iterable or multiple coordinate numbers. • covariant (bool or list of int, optional) – If False, all indices are contravariant. If a list of indices indices is supplied, the specified indices of the array will be covariant indices and all others contravariant indices. By default all indices are covariant. • **kwargs – Additional keyword arguments for the constructor of the numpy array as defined in numpy.array. array The underlying numpy array. Type numpy.ndarray

References

T The transposed tensor, same as self.transpose().

8 Chapter 1. Installation geometer Documentation, Release 0.2.3

copy() dtype The dtype of the underlying numpy array, same as self.array.dtype. Type numpy.dtype The rank of the Tensor, same as self.array.ndim. Type int shape The shape of the underlying numpy array, same as self.array.shape. Type tuple of int tensor_product(other) Return a new tensor that is the tensor product of this and the other tensor. This method will also reorder the indices of the resulting tensor, to ensure that covariant indices are in front of the contravariant indices. Parameters other (Tensor) – The other tensor. Returns The tensor product. Return type Tensor tensor_shape The shape or type of the tensor, the first number is the number of covariant indices, the second the number of contravariant indices. Type tuple of int transpose(perm=None) Permute the indices of the tensor. Parameters perm (tuple of int, optional) – A list of permuted indices or a shorter list represent- ing a permutation in cycle notation. By default, the indices are reversed. Returns The tensor with permuted indices. Return type Tensor class geometer.base.TensorDiagram(*edges) Bases: object A class used to specify and calculate tensor diagrams (also called Penrose Graphical Notation). Each edge in the diagram represents a contraction of two indices of the tensors connected by that edge. In 푖푘 Einstein-notation that would mean that an edge from tensor A to tensor B is equivalent to the expression 퐴푖푗퐵푙 , where 푗, 푘, 푙 are free indices. The indices to contract are chosen from front to back from contravariant and covariant indices of the tensors that are connected by an edge. Parameters *edges – Variable number of tuples, that represent the edge from one tensor to another.

References

add_edge(source, target) Add an edge to the diagram. Parameters • source (Tensor) – The source tensor of the edge in the diagram.

1.2. API Reference 9 geometer Documentation, Release 0.2.3

• target (Tensor) – The target tensor of the edge in the diagram. add_node(node) Add a node to the tensor diagram without adding an edge/contraction. A diagram of nodes where none are connected is equivalent to calculating the tensor product with the method Tensor.tensor_product(). Parameters node (Tensor) – The node to add. calculate() Calculates the result of the diagram. Returns The tensor resulting from the specified tensor diagram. Return type Tensor copy() geometer. module class geometer.curve.AlgebraicCurve(poly, symbols=None) Bases: geometer.base.ProjectiveElement A plane , defined by the zero of a homogeneous polynomial in 3 variables. Deprecated since version 0.2.1: The class AlgebraicCurve will be removed in geometer 0.3, use the module of sympy or another library instead. Parameters • poly (sympy.Expr or numpy.ndarray) – The polynomial defining the curve. It is automati- cally homogenized. • symbols (iterable of sympy.Symbol, optional) – The symbols that are used in the polynomial. By default the symbols (x0, x1, x2) will be used. symbols The symbols used in the polynomial defining the curve. Type tuple of sympy.Symbol contains(pt, tol=1e-08) Tests if a given point lies on the algebraic curve. Parameters • pt (Point) – The point to test. • tol (float, optional) – The accepted tolerance. Returns True if the curve contains the point. Return type bool degree The degree of the curve, i.e. the homogeneous order of the defining polynomial. Type int intersect(other) Calculates points of intersection with the algebraic curve. Parameters other (Line or AlgebraicCurve) – The object to intersect this curve with. Returns The points of intersection.

10 Chapter 1. Installation geometer Documentation, Release 0.2.3

Return type list of Point is_tangent(line) Tests if a given line is to the curve. The method compares the number of to the degree of the algebraic curve. If the line is tangent to the curve it will have at least a double intersection and using Bezout’s theorem we know that otherwise the number of intersections (counted without multiplicity) is equal to the degree of the curve. Parameters line (Line) – The line to test. Returns True if the given line is tangent to the algebraic curve. Return type bool polynomial The polynomial defining this curve. Type sympy.Poly tangent(at) Calculates the tangent of the curve at a given point. Parameters at (Point) – The point to calculate the tangent line at. Returns The tangent line. Return type Line class geometer.curve.Circle(center=Point(0.0, 0.0), =1, **kwargs) Bases: geometer.curve. A circle in 2D. Parameters • center (Point, optional) – The center point of the circle, default is Point(0, 0). • radius (float, optional) – The radius of the circle, default is 1. • **kwargs – Additional keyword arguments for the constructor of the numpy array as defined in numpy.array. The area of the circle. Type float center The center of the circle. Type Point intersection_angle(other) Calculates the angle of intersection of two using its Lie coordinates. Parameters other (Circle) – The circle to intersect this circle with. Returns The angle of intersection. Return type float

References

lie_coordinates The Lie coordinates of the circle as point in RP4.

1.2. API Reference 11 geometer Documentation, Release 0.2.3

Type Point radius The radius of the circle. Type float class geometer.curve.(=Point(0.0, 0.0, 0.0), base_center=Point(0.0, 0.0, 1.0), radius=1, **kwargs) Bases: geometer.curve.Quadric A quadric that forms a circular double cone in 3D. Parameters • vertex (Point, optional) – The vertex or apex of the cone. Default is (0, 0, 0). • base_center (Point, optional) – The center of the circle that forms the base of the cone. Default is (0, 0, 1) • radius (float, optional) – The radius of the circle forming the base of the cone. Default is 1. • **kwargs – Additional keyword arguments for the constructor of the numpy array as defined in numpy.array. class geometer.curve.Conic(matrix, is_dual=False, normalize_matrix=False, **kwargs) Bases: geometer.curve.Quadric A two-dimensional conic. foci The foci of the conic. Type tuple of Point classmethod from_crossratio(cr, a, b, c, d) Construct a conic from a cross ratio and four other points. This method relies on the fact that a point lies on a conic with five other points, if and only of the cross ratio seen from this point is the same as the cross ratio of four of the other points seen from the fifth point. Parameters • cr (float) – The crossratio of the other points that defines the conic. • a, b, c, d (Point) – The points lying on the conic. Returns The resulting conic. Return type Conic

References

classmethod from_foci(f1, f2, bound) Construct a conic with the given focal points that passes through the boundary point. Parameters • f1, f2 (Point) – The two focal points. • bound (Point) – A boundary point that lies on the conic. Returns The resulting conic. Return type Conic

12 Chapter 1. Installation geometer Documentation, Release 0.2.3

classmethod from_lines(g, h) Construct a degenerate conic from two lines. Parameters g, h (Line) – The two lines the conic consists of. Returns The resulting conic. Return type Conic classmethod from_points(a, b, c, d, e) Construct a conic through five points. Parameters a, b, c, d, e (Point) – The points lying on the conic. Returns The resulting conic. Return type Conic classmethod from_tangent(tangent, a, b, c, d) Construct a conic through four points and tangent to a line. Parameters • tangent (Line) • a, b, c, d (Point) – The points lying on the conic. Returns The resulting conic. Return type Conic intersect(other) Calculates points of intersection with the conic. Parameters other (Line or Conic) – The object to intersect this conic with. Returns The points of intersection. Return type list of Point

References

polar(pt) Calculates the polar line of the conic at a given point. Parameters pt (Point) – The point to calculate the polar at. Returns The polar line. Return type Line tangent(at) Calculates the tangent line at a given point or the tangent lines between a point and the conic. Parameters at (Point) – The point to calculate the tangent at. Returns The tangent line(s). Return type Line or tuple of Line class geometer.curve.(center=Point(0.0, 0.0, 0.0), direction=Point(0.0, 0.0, 1.0), ra- dius=1, **kwargs) Bases: geometer.curve.Cone A circular cylinder in 3D. Parameters

1.2. API Reference 13 geometer Documentation, Release 0.2.3

• center (Point, optional) – The center of the cylinder. Default is (0, 0, 0). • direction (Point) – The direction of the axis of the cylinder. Default is (0, 0, 1). • radius (float, optional) – The radius of the cylinder. Default is 1. • **kwargs – Additional keyword arguments for the constructor of the numpy array as defined in numpy.array. class geometer.curve.Ellipse(center=Point(0.0, 0.0), hradius=1, vradius=1, **kwargs) Bases: geometer.curve.Conic Represents an ellipse in 2D. Parameters • center (Point, optional) – The center of the ellipse, default is Point(0, 0). • hradius (float, optional) – The horizontal radius (along the x-axis), default is 1. • vradius (float, optional) – The vertical radius (along the y-axis), default is 1. • **kwargs – Additional keyword arguments for the constructor of the numpy array as defined in numpy.array. class geometer.curve.Quadric(matrix, is_dual=False, normalize_matrix=False, **kwargs) Bases: geometer.base.ProjectiveElement Represents a quadric, i.e. the zero set of a polynomial of degree 2, in any dimension. The quadric is defined by a symmetric matrix of size 푛 + 1 where 푛 is the dimension of the projective space. If 퐴 ∈ R(푛+1)×(푛+1), the quadric contains all points 푥 ∈ R푛+1 such that 푥푇 퐴푥 = 0. Parameters • matrix (array_like or Tensor) – A two-dimensional array defining the (n+1)x(n+1) sym- metric matrix of the quadric. • is_dual (bool, optional) – If true, the quadric represents a dual quadric, i.e. all tangent to the non-dual quadric. • normalize_matrix (bool, optional) – If true, normalize matrix using the (n+1)-th root of the absolute value of its pseudo-determinant. • **kwargs – Additional keyword arguments for the constructor of the numpy array as defined in numpy.array. is_dual True if the quadric is a dual quadric i.e. contains all hyperplanes tangent to the non-dual quadric. Type bool symbols The symbols used in the polynomial defining the hypersurface. Type tuple of sympy.Symbol components The components of a degenerate quadric. Type list of ProjectiveElement contains(other, tol=1e-08) Tests if a given point lies on the quadric. Parameters

14 Chapter 1. Installation geometer Documentation, Release 0.2.3

• other (Point or Subspace) – The point or to test. • tol (float, optional) – The accepted tolerance. Returns True if the quadric contains the point. Return type bool dual The dual quadric. Type Quadric classmethod from_planes(e, f ) Construct a degenerate quadric from two hyperplanes. Parameters e, f (Plane) – The two planes the quadric consists of. Returns The resulting quadric. Return type Quadric intersect(other) Calculates points of intersection of a line with the quadric. This method also returns complex points of intersection, even if the quadric and the line do not intersect in any real points. Parameters other (Line) – The line to intersect this quadric with. Returns The points of intersection. Return type list of Point

References

is_degenerate True if the quadric is degenerate. Type bool is_tangent(plane) Tests if a given hyperplane is tangent to the quadric. Parameters plane (Subspace) – The hyperplane to test. Returns True if the given hyperplane is tangent to the quadric. Return type bool polynomial The polynomial defining this quadric. Type sympy.Poly tangent(at) Returns the hyperplane defining the tangent space at a given point. Parameters at (Point) – A point on the quadric at which the tangent plane is calculated. Returns The tangent plane at the given point. Return type Plane

1.2. API Reference 15 geometer Documentation, Release 0.2.3

class geometer.curve.(center=Point(0.0, 0.0, 0.0), radius=1, **kwargs) Bases: geometer.curve.Quadric A sphere in any dimension. Parameters • center (Point, optional) – The center of the sphere, default is Point(0, 0, 0). • radius (float, optional) – The radius of the sphere, default is 1. • **kwargs – Additional keyword arguments for the constructor of the numpy array as defined in numpy.array. area The area of the sphere. Type float center The center of the sphere. Type Point radius The radius of the sphere. Type float The volume of the sphere. Type float geometer.exceptions module exception geometer.exceptions.GeometryException Bases: Exception A general geometric error occurred. exception geometer.exceptions.IncidenceError Bases: geometer.exceptions.GeometryException, ValueError The given objects were not incident to each other. exception geometer.exceptions.LinearDependenceError Bases: geometer.exceptions.GeometryException, ValueError The given values were linearly dependent, making the computation impossible. exception geometer.exceptions.NotCollinear Bases: geometer.exceptions.GeometryException, ValueError The given values are not collinear. exception geometer.exceptions.NotCoplanar Bases: geometer.exceptions.GeometryException, ValueError The given values are not coplanar. exception geometer.exceptions.NotReducible Bases: geometer.exceptions.GeometryException, ValueError The given geometric object is not reducible.

16 Chapter 1. Installation geometer Documentation, Release 0.2.3 exception geometer.exceptions.TensorComputationError Bases: geometer.exceptions.GeometryException An error during a tensor computation occurred. geometer.operators module geometer.operators.angle(*args) Calculates the (oriented) angle between given points, lines or planes. The function uses the Laguerre formula to calculate angles in two or three dimensional projective space using cross ratios. To calculate the angle between two planes, two additional planes tangent to the absolute conic are constructed (see [1]). Since the Laguerre formula uses the complex logarithm (which gives values between −휋푖 and 휋푖) and multiplies it with 1/2푖, this function can only calculate angles between −휋/2 and 휋/2. The sign of the angle is determined by the order of the arguments. The points passed to the cross ratio are in the same order as the arguments to this function. When three points are given as arguments, the first point is the point at which the angle is calculated. Parameters *args – The objects between which the function calculates the angle. This can be 2 or 3 points, 2 lines or 2 planes. Returns The oriented angle between the given objects. Return type float

References geometer.operators.angle_bisectors(l, m) Constructs the angle bisectors of two given lines. Parameters l, m (Line) – Two lines in any dimension. Returns The two angle bisectors. Return type tuple of Line geometer.operators.crossratio(a, b, c, d, from_point=None) Calculates the cross ratio of points or lines. Parameters • a, b, c, d (Point, Line or Plane) – The points, lines or planes (any dimension) to calculate the cross ratio of. • from_point (Point, optional) – A 2D point, only accepted if the other arguments are also 2D points. Returns The cross ration of the given objects. Return type float or complex geometer.operators.dist(p, q) Calculates the (euclidean) between two objects. Parameters p, q (Point, Line or Plane) – The points, lines or planes to calculate the distance be- tween. Returns The distance between the given objects. Return type float

1.2. API Reference 17 geometer Documentation, Release 0.2.3 geometer.operators.harmonic_set(a, b, c) Constructs a fourth point that forms a harmonic set with the given points. The three given points must be collinear. If the returned point is d, the points {{a, b}, {c, d}} will be in harmonic position. Parameters a, b, c (Point) – The points (any dimension) that are used to construct the fourth point in the harmonic set. Returns The point that forms a harmonic set with the given points. Return type Point geometer.operators.is_cocircular(a, b, c, d, rtol=1e-15, atol=1e-08) Tests whether four points lie on a circle. Parameters • a, b, c, d (Point) – Four points in RP2 or CP1. • rtol (float, optional) – The relative tolerance parameter. • atol (float, optional) – The absolute tolerance parameter. Returns True if the four points lie on a circle. Return type bool geometer.operators.is_collinear(*args, tol=1e-08) Tests whether the given points or lines are collinear, coplanar or concurrent. Works in any dimension. Due to line point duality this function has dual versions is_collinear and is_concurrent. Parameters • *args – The points or lines to test. • tol (float, optional) – The accepted tolerance. Returns True if the given points are coplanar (in 3D) or collinear (in 2D) or if the given lines are concurrent. Return type bool geometer.operators.is_concurrent(*args, tol=1e-08) Tests whether the given points or lines are collinear, coplanar or concurrent. Works in any dimension. Due to line point duality this function has dual versions is_collinear and is_concurrent. Parameters • *args – The points or lines to test. • tol (float, optional) – The accepted tolerance. Returns True if the given points are coplanar (in 3D) or collinear (in 2D) or if the given lines are concurrent. Return type bool geometer.operators.is_coplanar(*args, tol=1e-08) Tests whether the given points or lines are collinear, coplanar or concurrent. Works in any dimension. Due to line point duality this function has dual versions is_collinear and is_concurrent. Parameters • *args – The points or lines to test.

18 Chapter 1. Installation geometer Documentation, Release 0.2.3

• tol (float, optional) – The accepted tolerance. Returns True if the given points are coplanar (in 3D) or collinear (in 2D) or if the given lines are concurrent. Return type bool geometer.operators.is_perpendicular(l, m, rtol=1e-15, atol=1e-08) Tests whether two lines/planes are perpendicular. Parameters • l, m (Line or Plane) – Two lines in any dimension or two planes in 3D. • rtol (float, optional) – The relative tolerance parameter. • atol (float, optional) – The absolute tolerance parameter. Returns True if the two lines/planes are perpendicular. Return type bool geometer.point module class geometer.point.Line(*args, **kwargs) Bases: geometer.point.Subspace Represents a line in a projective space of arbitrary dimension. Parameters • *args – Two points or the coordinates of the line. Instead of all coordinates separately, a single iterable can also be supplied. • **kwargs – Additional keyword arguments for the constructor of the numpy array as defined in numpy.array. base_point A base point for the line, arbitrarily chosen. Type Point basis_matrix A matrix with orthonormal basis vectors as rows. Type numpy.ndarray contravariant_tensor The contravariant version of a line in 3D. Type Line covariant_tensor The covariant version of a line in 3D. Type Line direction The direction of the line (not normalized). Type Point is_coplanar(other) Tests whether another line lies in the same plane as this line, i.e. whether two lines intersect. Parameters other (Line) – A line in 3D to test.

1.2. API Reference 19 geometer Documentation, Release 0.2.3

Returns True if the two lines intersect (i.e. they lie in the same plane). Return type bool

References

lie_coordinates The Lie coordinates of a line in 2D. Type Point mirror(pt) Construct the reflection of a point at this line. Parameters pt (Point) – The point to reflect. Returns The mirror point. Return type Point

References

perpendicular(through) Construct the perpendicular line though a point. Parameters through (Point) – The point through which the perpendicular is constructed. Returns The perpendicular line. Return type Line project(pt) The orthogonal projection of a point onto the line. Parameters pt (Point) – The point to project. Returns The projected point. Return type Point class geometer.point.Plane(*args, **kwargs) Bases: geometer.point.Subspace Represents a hyperplane in a projective space of arbitrary dimension. Parameters • *args – The points/lines spanning the plane or the coordinates of the hyperplane. Instead of separate coordinates, a single iterable can be supplied. • **kwargs – Additional keyword arguments for the constructor of the numpy array as defined in numpy.array. basis_matrix A matrix with orthonormal basis vectors as rows. Type numpy.ndarray mirror(pt) Construct the reflection of a point at this plane. Only works in 3D. Parameters pt (Point) – The point to reflect.

20 Chapter 1. Installation geometer Documentation, Release 0.2.3

Returns The mirror point. Return type Point perpendicular(through) Construct the perpendicular line though a point. Only works in 3D. Parameters through (Point) – The point through which the perpendicular is constructed. Returns The perpendicular line. Return type Line polynomial The polynomial defining this hyperplane. Type sympy.Poly project(pt) The orthogonal projection of a point onto the plane. Only works in 3D. Parameters pt (Point) – The point to project. Returns The projected point. Return type Point class geometer.point.Point(*args, **kwargs) Bases: geometer.base.ProjectiveElement Represents points in a projective space of arbitrary dimension. The number of supplied coordinates determines the dimension of the space that the point lives in. If the coor- dinates are given as arguments (not in a single iterable), the coordinates will automatically be transformed into homogeneous coordinates, i.e. a one added as an additional coordinate. Addition and subtraction of finite and infinite points will always give a finite result if one of the points was finite beforehand. Parameters • *args – A single iterable object or tensor or multiple (affine) coordinates. • **kwargs – Additional keyword arguments for the constructor of the numpy array as defined in numpy.array. isinf join(*others) Execute the join of this point with other objects. Parameters *others – The objects to join the point with. Returns The result of the join operation. Return type Subspace See also: join() lie_coordinates The Lie coordinates of a point in 2D.

1.2. API Reference 21 geometer Documentation, Release 0.2.3

Type Point normalized_array The normalized coordinates as array. Type numpy.ndarray class geometer.point.Subspace(*args, **kwargs) Bases: geometer.base.ProjectiveElement Represents a general subspace of a projective space. Line and Plane are subclasses. Parameters • *args – The coordinates of the subspace. Instead of separate coordinates, a single iterable can be supplied. • **kwargs – Additional keyword arguments for the constructor of the numpy array as defined in numpy.array. basis_matrix A matrix with orthonormal basis vectors as rows. Type numpy.ndarray contains(other, tol=1e-08) Tests whether a given point or line lies in the subspace. Parameters • other (Point or Line) – The object to test. • tol (float, optional) – The accepted tolerance. Returns True, if the given point/line lies in the subspace. Return type bool general_point A point in i.e. not in the subspace, to be used in geometric constructions. Type Point is_parallel(other) Tests whether a given subspace is parallel to this subspace. Parameters other (Subspace) – The other space to test. Returns True, if the two are parallel. Return type bool join(*others) Execute the join of the subspace with other objects. Parameters *others – The objects to join the subspace with. Returns The result of the join operation. Return type Subspace See also: join() meet(*others) Intersect the subspace with other objects.

22 Chapter 1. Installation geometer Documentation, Release 0.2.3

Parameters *others – The objects to intersect the subspace with. Returns The result of the meet operation. Return type Point or Subspace See also: meet() parallel(through) Returns the subspace through a given point that is parallel to this subspace. Parameters through (Point) – The point through which the parallel subspace is to be con- structed. Returns The parallel subspace. Return type Subspace polynomials(symbols=None) Returns a list of polynomials, to use for symbolic calculations. Deprecated since version 0.2.1: polynomials will be removed in geometer 0.3. Parameters symbols (list of sympy.Symbol, optional) – The symbols used in the resulting poly- nomial. By default “x1”, . . . , “xn” will be used. Returns The polynomials describing the subspace. Return type list of sympy.Poly geometer.point.infty_hyperplane(dimension) geometer.point.join(*args) Joins a number of objects to form a line, plane or subspace. Parameters *args – Objects to join, e.g. 2 points, lines, a point and a line or 3 points. Returns The resulting line, plane or subspace. Return type Subspace geometer.point.meet(*args) Intersects a number of given objects. Parameters *args – Objects to intersect, e.g. two lines, planes, a plane and a line or 3 planes. Returns The resulting point, line or subspace. Return type Point or Subspace geometer. module class geometer.shapes.(a, b, c, d, **kwargs) Bases: geometer.shapes.Polyhedron A class that can be used to construct a cuboid/box or a . Parameters • a (Point) – The base point of the cuboid. • b (Point) – The vertex that determines the first direction of the edges. • c (Point) – The vertex that determines the second direction of the edges.

1.2. API Reference 23 geometer Documentation, Release 0.2.3

• d (Point) – The vertex that determines the third direction of the edges. • **kwargs – Additional keyword arguments for the constructor of the numpy array as defined in numpy.array. class geometer.shapes.(*args, **kwargs) Bases: geometer.shapes.Polytope A flat polygon with vertices in any dimension. Parameters • *args – The coplanar points that are the vertices of the polygon. They will be connected sequentially by line segments. • **kwargs – Additional keyword arguments for the constructor of the numpy array as defined in numpy.array. angles The interior angles of the polygon. Type list of float area The area of the polygon. Type float centroid The centroid (center of mass) of the polygon. Type Point contains(other) Tests whether a point is contained in the polygon. Points on an edge of the polygon are considered True. Parameters other (Point) – The point to test. Returns True if the point is contained in the polygon. Return type bool

References

edges The edges of the polygon. Type list of Segment facets The facets of the polytope. Type list of Polytope intersect(other) Intersect the polygon with another object. Parameters other (Line or Segment) – The object to intersect the polygon with. Returns The points of intersection. Return type list of Point

24 Chapter 1. Installation geometer Documentation, Release 0.2.3

vertices The vertices of the polytope. Type list of Point class geometer.shapes.Polyhedron(*args, **kwargs) Bases: geometer.shapes.Polytope A class representing polyhedra (3-polytopes). area The surface area of the polyhedron. Type float edges The edges of the polyhedron. Type list of Segment faces The faces of the polyhedron. Type list of Polygon intersect(other) Intersect the polyhedron with another object. Parameters other (Line or Segment) – The object to intersect the polyhedron with. Returns The points of intersection. Return type list of Point class geometer.shapes.Polytope(*args, **kwargs) Bases: geometer.base.Tensor A class representing polytopes in arbitrary dimension. A (n+1)-polytope is a collection of n-polytopes that have some (n-1)-polytopes in common, where 3-polytopes are polyhedra, 2-polytopes are and 1-polytopes are line segments. The polytope is stored as a multidimensional numpy array. Hence, all facets of the polytope must have the same number of vertices and facets. Parameters • *args – The polytopes defining the facets ot the polytope. • **kwargs – Additional keyword arguments for the constructor of the numpy array as defined in numpy.array. array The underlying numpy array. Type numpy.ndarray dim The dimension of the space that the polytope lives in. Type int facets The facets of the polytope. Type list of Polytope

1.2. API Reference 25 geometer Documentation, Release 0.2.3

normalized_array Array containing only normalized vertex coordinates. Type numpy.ndarray vertices The vertices of the polytope. Type list of Point class geometer.shapes.(*args, **kwargs) Bases: geometer.shapes.Polygon A class representing . Parameters • a (Point) • b (Point) • c (Point) • d (Point) class geometer.shapes.RegularPolygon(center, radius, n, axis=None, **kwargs) Bases: geometer.shapes.Polygon A class that can be used to construct from a radius and a center point. Parameters • center (Point) – The center of the polygon. • radius (float) – The distance from the center to the vertices of the polygon. • n (int) – The number of vertices of the regular polygon. • axis (Point, optional) – If constructed in higher-dimensional spaces, an axis vector is re- quired to orient the polygon. • **kwargs – Additional keyword arguments for the constructor of the numpy array as defined in numpy.array. center The center of the polygon. Type Point inradius The inradius of the regular polygon. Type float radius The Circumradius of the regular polygon. Type float class geometer.shapes.Segment(*args, **kwargs) Bases: geometer.shapes.Polytope Represents a in an arbitrary projective space. Segments with one point at infinity represent rays/half-lines in a traditional sense. Parameters

26 Chapter 1. Installation geometer Documentation, Release 0.2.3

• *args – The start and endpoint of the line segment, either as two Point objects or a single coordinate array. • **kwargs – Additional keyword arguments for the constructor of the numpy array as defined in numpy.array. contains(other, tol=1e-08) Tests whether a point is contained in the segment. Parameters • other (Point) – The point to test. • tol (float, optional) – The accepted tolerance. Returns True if the point is contained in the segment. Return type bool intersect(other) Intersect the line segment with another object. Parameters other (Line, Plane, Segment, Polygon or Polyhedron) – The object to intersect the line segment with. Returns The points of intersection. Return type list of Point length The length of the segment. Type float midpoint The midpoint of the segment. Type Point class geometer.shapes.Simplex(*args, **kwargs) Bases: geometer.shapes.Polytope Represents a simplex in any dimension, i.e. a k-polytope with k+1 vertices where k is the dimension. The simplex determined by k+1 points is given by the convex hull of these points. Parameters • *args – The points that are the vertices of the simplex. • **kwargs – Additional keyword arguments for the constructor of the numpy array as defined in numpy.array. volume The volume of the simplex, calculated using the Cayley–Menger determinant. Type float class geometer.shapes.(*args, **kwargs) Bases: geometer.shapes.Polygon, geometer.shapes.Simplex A class representing . Parameters • a (Point) • b (Point)

1.2. API Reference 27 geometer Documentation, Release 0.2.3

• c (Point) geometer.transformation module class geometer.transformation.Transformation(*args, **kwargs) Bases: geometer.base.ProjectiveElement Represents a projective transformation in an arbitrary projective space. The underlying array is the matrix representation of the projective transformation. The matrix must be a non- singular matrix of size n+1 when n is the dimension of the projective space. The transformation can be applied to a point or another object by multiplication. Parameters • *args – The array that defines the matrix representing the transformation. • **kwargs – Additional keyword arguments for the constructor of the numpy array as defined in numpy.array. apply(other) Apply the transformation to another object. Parameters other (Tensor) – The object to apply the transformation to. Returns The result of applying this transformation to the supplied object. Return type Tensor classmethod from_points(*args) Constructs a projective transformation in n-dimensional projective space from the image of n + 2 points in general position. For two dimensional transformations, 4 pairs of points are required, of which no three points are collinear. For three dimensional transformations, 5 pairs of points are required, of which no four points are coplanar. Parameters *args – Pairs of points, where in each pair one point is mapped to the other. Returns The transformation mapping each of the given points to the specified points. Return type Transformation

References

inverse() Calculates the inverse projective transformation. Returns The inverse transformation. Return type Transformation geometer.transformation.affine_transform(matrix=None, offset=0) Returns a projective transformation for the given affine transformation. Parameters • matrix (array_like, optional) – The transformation matrix. • offset (array_like or float, optional) – The translation. Returns The projective transformation that represents the affine transformation. Return type Transformation

28 Chapter 1. Installation geometer Documentation, Release 0.2.3 geometer.transformation.identity(dim) Returns the identity transformation. Parameters dim (int) – The dimension of the projective space that the transformation acts on. Returns The identity transformation. Return type Transformation geometer.transformation.reflection(axis) Returns a projective transformation that represents a reflection at the given axis/hyperplane. Parameters axis (Subspace) – The 2D-line or hyperplane to reflect points at. Returns The reflection. Return type Transformation

References geometer.transformation.rotation(angle, axis=None) Returns a projective transformation that represents a rotation by the specified angle (and axis). Parameters • angle (float) – The angle to rotate by. • axis (Point, optional) – The axis to rotate around when rotating points in 3D. Returns The rotation. Return type Transformation

References geometer.transformation.scaling(*factors) Returns a projective transformation that represents general scaling by given factors in each dimension. Parameters *factors – The scaling factors by which each dimension is scaled. Returns The scaling transformation. Return type Transformation geometer.transformation.translation(*coordinates) Returns a projective transformation that represents a translation by the given coordinates. Parameters *coordinates – The coordinates by which points are translated when applying the re- sulting transformation. Returns The translation. Return type Transformation

1.2. API Reference 29 geometer Documentation, Release 0.2.3

1.3 Changelog

1.3.1 0.2.3 - released (8.7.2020)

1.3.2 New Features

• Added Tensor.dtype property • Added parameters to Tensor class to control ndarray creation (e.g. for setting the dtype) • Quadrics can now be normalized using their (pseudo-) determinant to reduce numerical errors • The underlying arrays of tensors are copied less often (controlled by copy parameter) • Implemented addition/subtraction of points to a quadric • Transformations can be applied to any object of type Tensor • More robust algorithm for calculating the intersection of conics • Added a determinant function that is faster for matrices in dimension 2 and 3 • Updated dependencies (up to NumPy 1.19 and SymPy 1.6 now supported)

1.3.3 Bug fixes

• Fixed error that was raised when integer arrays are normalized in the join/meet function • Fixed issues caused by an array not being converted to a Point object in Line.base_point and Line.directions • Correct handling of special cases in the calculation of the crossing number in Polygon.contains • Trying to raise an arbitrary tensor to power zero now correctly raises an NotImplementedError • Equality of polytopes is determined correctly even if the vertices are in a different order

1.3.4 0.2.2 - released (15.2.2020)

1.3.5 New Features

• New adjugate function in utils.math • New algorithms for Segment.contains, Conic.intersect & Conic.from_crossratio

1.3.6 Bug fixes

• Fixed an issue with numerical stability when intersecting transformed polytopes (issue #24) • Conic.components uses a better algorithm that should give correct results in all cases • Quadric.intersect no longer throws a ValueError when a 3D line has only a single point of intersection • Line.base_point will now try to always return finite points and Line.direction a point at infinity • Arrays with small component values are handled correctly by the is_multiple function • Fixed an issue with Polygon.contains that caused the direction used in the method to be close to zero (issue #25) • Transformation of line in 3D now works correctly

30 Chapter 1. Installation geometer Documentation, Release 0.2.3

• The functions null_space and orth now use the same threshold values as Matlab for truncating the singular values

1.3.7 0.2.1 - released (3.2.2020)

1.3.8 New Features

• Added properties shape, rank and T to Tensor class • Tensor instances can be raised to an arbitrary positive power • Dynamic calculation of center and radius attributes of RegularPolygon instances • Added RegularPolygon.inradius property • Polytope is now a subclass of Tensor • Added functions for generating transforms that perform scaling and reflections • Added Polygon.centroid property • Updated numpy to version 1.18

1.3.9 Bug fixes

• Transformations are now applied correctly to quadrics and conics • Fixed bug that made transformation of Cuboid & RegularPolygon fail (issue #23) • Raising transformations to a power (other than 1) is calculated correctly • Tolerance parameters are correctly used in Tensor.__eq__ • Scalar multiplication with Points is calculated correctly using normalized_array • Fixed copy method Tensor subclasses • Return real angles instead of angles with complex type • Fixed init method of regular polygons that aren’t centered at the origin • Indices passed to Tensor constructor are validated and negative indices converted • Fixed init method of Cone & Cylinder classes

1.3.10 Deprecations

• Deprecated AlgebraicCurve, Subspace.polygons, Plane.polygon, Quadric.polygon and the module utils.polynomial in preparation of removal of sympy as dependency

1.3.11 0.2 - released (15.9.2019)

1.3.12 New Features

• New shapes module that implements line segments, polygons and general polytopes • New Sphere class (a subclass of Quadric) that works in any dimension • New classes representing a cone and a cylinder in 3D • Tensor has a new tensor_product method to calculate the tensor product with another tensor

1.3. Changelog 31 geometer Documentation, Release 0.2.3

• Ellipse class that constructs a conic from center and radius • Added Conic.foci and Conic.polar • Construct a conic from its focal points, using a tangent line or a cross ratio • Faster and more general intersect method for quadrics • Refactored & documented the code for calculation of tensor diagrams • New KroneckerDelta tensor • TensorDiagram calculates results differently, using free indices from front to back • New method TensorDiagram.add_node to add tensors without edge to the diagram • Added Circle.intersection_angle to calculate the angle of intersection of two circles • is_perpendicular now works with two planes • New function is_multiple in utils module

1.3.13 Bug fixes

• Plane.perpendicular now also works for points that lie on the plane • Addition/Subtraction of subspaces and points works in more cases • Adding a point at infinity to another point will give a finite point moved in that direction • Globally accessible tolerance parameters to avoid inaccurate calculations (issue #22) • Fixed Transformation.from_points

1.3.14 0.1.2 - released (24.2.2019)

1.3.15 New Features

• Optimized performance of Conic, LeviCivitaTensor and TensorDiagram • More operations are now compatible with higher-dimensional objects • New Subspace class that can be used to represent subspaces of any dimension • New repr and copy methods of Tensor • scipy is no longer a dependency

1.3.16 Bug fixes

• Rotation in 3D now returns the correct transformation if the axis is not a normalized vector • Line.perpendicular now also works for points tha lie on the line

1.3.17 0.1.1 - released (2.2.2019)

32 Chapter 1. Installation CHAPTER 2

Indices and tables

• genindex • modindex • search

2.1 References

Many of the algorithms and formulas implemented in the package are taken from the following books and papers: • Jürgen Richter-Gebert, Perspectives on Projective Geometry • Jürgen Richter-Gebert and Thorsten Orendt, Geometriekalküle • Olivier Faugeras, Three-Dimensional Computer Vision • Jim Blinn, Lines in Space: The 4D Cross Product • Jim Blinn, Lines in Space: The Line Formulation • Jim Blinn, Lines in Space: The Two Matrices • Jim Blinn, Lines in Space: Back to the Diagrams • Jim Blinn, Lines in Space: A Tale of Two Lines • Jim Blinn, Lines in Space: Our Friend the Hyperbolic Paraboloid • Jim Blinn, Lines in Space: The Algebra of Tinkertoys • Jim Blinn, Lines in Space: Line(s) through Four Lines

33 geometer Documentation, Release 0.2.3

34 Chapter 2. Indices and tables Python Module Index

g geometer.base,7 geometer.curve, 10 geometer.exceptions, 16 geometer.operators, 17 geometer.point, 19 geometer.shapes, 23 geometer.transformation, 28 geometer.utils.math,5 geometer.utils.polynomial,6

35 geometer Documentation, Release 0.2.3

36 Python Module Index Index

A Conic (class in geometer.curve), 12 add_edge() (geometer.base.TensorDiagram method), contains() (geometer.curve.AlgebraicCurve method), 9 10 add_node() (geometer.base.TensorDiagram method), contains() (geometer.curve.Quadric method), 14 10 contains() (geometer.point.Subspace method), 22 adjugate() (in module geometer.utils.math),5 contains() (geometer.shapes.Polygon method), 24 affine_transform() (in module geome- contains() (geometer.shapes.Segment method), 27 ter.transformation), 28 contravariant_tensor (geometer.point.Line at- AlgebraicCurve (class in geometer.curve), 10 tribute), 19 angle() (in module geometer.operators), 17 copy() (geometer.base.Tensor method),8 angle_bisectors() (in module geome- copy() (geometer.base.TensorDiagram method), 10 ter.operators), 17 covariant_tensor (geometer.point.Line attribute), angles (geometer.shapes.Polygon attribute), 24 19 apply() (geometer.transformation.Transformation crossratio() (in module geometer.operators), 17 method), 28 Cuboid (class in geometer.shapes), 23 area (geometer.curve.Circle attribute), 11 Cylinder (class in geometer.curve), 13 area (geometer.curve.Sphere attribute), 16 area (geometer.shapes.Polygon attribute), 24 D area (geometer.shapes.Polyhedron attribute), 25 degree (geometer.curve.AlgebraicCurve attribute), 10 array (geometer.base.Tensor attribute),8 det() (in module geometer.utils.math),5 array (geometer.shapes.Polytope attribute), 25 dim (geometer.base.ProjectiveElement attribute),8 dim (geometer.shapes.Polytope attribute), 25 B direction (geometer.point.Line attribute), 19 base_point (geometer.point.Line attribute), 19 dist() (in module geometer.operators), 17 basis_matrix (geometer.point.Line attribute), 19 dtype (geometer.base.Tensor attribute),9 basis_matrix (geometer.point.Plane attribute), 20 dual (geometer.curve.Quadric attribute), 15 basis_matrix (geometer.point.Subspace attribute), 22 E edges (geometer.shapes.Polygon attribute), 24 C edges (geometer.shapes.Polyhedron attribute), 25 calculate() (geometer.base.TensorDiagram Ellipse (class in geometer.curve), 14 method), 10 center (geometer.curve.Circle attribute), 11 F center (geometer.curve.Sphere attribute), 16 faces (geometer.shapes.Polyhedron attribute), 25 center (geometer.shapes.RegularPolygon attribute), 26 facets (geometer.shapes.Polygon attribute), 24 centroid (geometer.shapes.Polygon attribute), 24 facets (geometer.shapes.Polytope attribute), 25 Circle (class in geometer.curve), 11 foci (geometer.curve.Conic attribute), 12 components (geometer.curve.Quadric attribute), 14 from_crossratio() (geometer.curve.Conic class Cone (class in geometer.curve), 12 method), 12

37 geometer Documentation, Release 0.2.3 from_foci() (geometer.curve.Conic class method), 12 is_concurrent() (in module geometer.operators), from_lines() (geometer.curve.Conic class method), 18 12 is_coplanar() (geometer.point.Line method), 19 from_planes() (geometer.curve.Quadric class is_coplanar() (in module geometer.operators), 18 method), 15 is_degenerate (geometer.curve.Quadric attribute), from_points() (geometer.curve.Conic class method), 15 13 is_dual (geometer.curve.Quadric attribute), 14 from_points() (geome- is_multiple() (in module geometer.utils.math),5 ter.transformation.Transformation class is_parallel() (geometer.point.Subspace method), method), 28 22 from_tangent() (geometer.curve.Conic class is_perpendicular() (in module geome- method), 13 ter.operators), 19 is_tangent() (geometer.curve.AlgebraicCurve G method), 11 general_point (geometer.point.Subspace attribute), is_tangent() (geometer.curve.Quadric method), 15 22 isinf (geometer.point.Point attribute), 21 geometer.base (module),7 geometer.curve (module), 10 J geometer.exceptions (module), 16 join() (geometer.point.Point method), 21 geometer.operators (module), 17 join() (geometer.point.Subspace method), 22 geometer.point (module), 19 join() (in module geometer.point), 23 geometer.shapes (module), 23 geometer.transformation (module), 28 K geometer.utils.math (module),5 KroneckerDelta (class in geometer.base),7 geometer.utils.polynomial (module),6 GeometryException, 16 L H length (geometer.shapes.Segment attribute), 27 LeviCivitaTensor (class in geometer.base),8 harmonic_set() (in module geometer.operators), 18 lie_coordinates (geometer.curve.Circle attribute), hat_matrix() (in module geometer.utils.math),5 11 lie_coordinates (geometer.point.Line attribute), 20 I lie_coordinates (geometer.point.Point attribute), identity() (in module geometer.transformation), 28 21 IncidenceError, 16 Line (class in geometer.point), 19 infty_hyperplane() (in module geometer.point), LinearDependenceError, 16 23 inradius (geometer.shapes.RegularPolygon attribute), M 26 meet() (geometer.point.Subspace method), 22 intersect() (geometer.curve.AlgebraicCurve meet() (in module geometer.point), 23 method), 10 midpoint (geometer.shapes.Segment attribute), 27 intersect() (geometer.curve.Conic method), 13 mirror() (geometer.point.Line method), 20 intersect() (geometer.curve.Quadric method), 15 mirror() (geometer.point.Plane method), 20 intersect() (geometer.shapes.Polygon method), 24 intersect() (geometer.shapes.Polyhedron method), N 25 normalized_array (geometer.point.Point attribute), intersect() (geometer.shapes.Segment method), 27 22 intersection_angle() (geometer.curve.Circle normalized_array (geometer.shapes.Polytope at- method), 11 tribute), 25 inverse() (geometer.transformation.Transformation NotCollinear, 16 method), 28 NotCoplanar, 16 is_cocircular() (in module geometer.operators), NotReducible, 16 18 np_array_to_poly() (in module geome- is_collinear() (in module geometer.operators), 18 ter.utils.polynomial),6

38 Index geometer Documentation, Release 0.2.3

null_space() (in module geometer.utils.math),6 tangent() (geometer.curve.AlgebraicCurve method), 11 O tangent() (geometer.curve.Conic method), 13 orth() (in module geometer.utils.math),6 tangent() (geometer.curve.Quadric method), 15 Tensor (class in geometer.base),8 P tensor_product() (geometer.base.Tensor method), parallel() (geometer.point.Subspace method), 23 9 perpendicular() (geometer.point.Line method), 20 tensor_shape (geometer.base.Tensor attribute),9 perpendicular() (geometer.point.Plane method), 21 TensorComputationError, 16 Plane (class in geometer.point), 20 TensorDiagram (class in geometer.base),9 Point (class in geometer.point), 21 Transformation (class in geometer.transformation), polar() (geometer.curve.Conic method), 13 28 poly_to_np_array() (in module geome- translation() (in module geometer.transformation), ter.utils.polynomial),6 29 Polygon (class in geometer.shapes), 24 transpose() (geometer.base.Tensor method),9 Polyhedron (class in geometer.shapes), 25 Triangle (class in geometer.shapes), 27 polynomial (geometer.curve.AlgebraicCurve at- tribute), 11 V polynomial (geometer.curve.Quadric attribute), 15 vertices (geometer.shapes.Polygon attribute), 24 polynomial (geometer.point.Plane attribute), 21 vertices (geometer.shapes.Polytope attribute), 26 polynomials() (geometer.point.Subspace method), volume (geometer.curve.Sphere attribute), 16 23 volume (geometer.shapes.Simplex attribute), 27 Polytope (class in geometer.shapes), 25 polyval() (in module geometer.utils.polynomial),7 project() (geometer.point.Line method), 20 project() (geometer.point.Plane method), 21 ProjectiveElement (class in geometer.base),8 Q Quadric (class in geometer.curve), 14 R radius (geometer.curve.Circle attribute), 12 radius (geometer.curve.Sphere attribute), 16 radius (geometer.shapes.RegularPolygon attribute), 26 rank (geometer.base.Tensor attribute),9 Rectangle (class in geometer.shapes), 26 reflection() (in module geometer.transformation), 29 RegularPolygon (class in geometer.shapes), 26 rotation() (in module geometer.transformation), 29 S scaling() (in module geometer.transformation), 29 Segment (class in geometer.shapes), 26 shape (geometer.base.Tensor attribute),9 Simplex (class in geometer.shapes), 27 Sphere (class in geometer.curve), 15 Subspace (class in geometer.point), 22 symbols (geometer.curve.AlgebraicCurve attribute), 10 symbols (geometer.curve.Quadric attribute), 14 T T (geometer.base.Tensor attribute),8

Index 39