clifford.tools.g3c¶
Tools for 3DCGA (g3c)
3DCGA Tools¶
Generation Methods¶
Creates a random bivector on the form described by R. |
|
Creates a standard point pair at the origin |
|
Creates a random point pair bivector object at the origin |
|
Creates a random point pair bivector object |
|
Creates a standard line at the origin |
|
Creates a random line at the origin |
|
Creates a random line |
|
Creates a random circle at the origin |
|
Creates a random circle |
|
Creates a random sphere at the origin |
|
Creates a random sphere |
|
Creates a random plane at the origin |
|
Creates a random plane |
|
|
Creates n_clusters of random objects |
|
Creates a cluster of random objects |
|
generate a random translation rotor |
generate a random combined rotation and translation rotor |
|
|
Creates a random conformal point |
|
Generates a rotor that performs dilation about the origin |
|
Generates a rotor that translates objects along the euclidean vector euc_vector_a |
Geometry Methods¶
|
Returns the point at the intersection of a line and plane If there is no intersection it returns None |
Returns the point at the intersection of a line and plane |
|
|
Takes in a quaternion and a vector and returns a conformal rotor that implements the transformation |
|
Returns the conformal point at the centre of a sphere by reflecting the point at infinity |
|
Returns the radius of a sphere |
Extracts the end points of a point pair bivector |
|
Extracts the end points of a point pair bivector |
|
|
Extracts all the normal stuff for a circle |
returns the sphere for which the input circle is the perimeter |
|
converts a line to the conformal nearest point to the origin and a euc direction vector in direction of the line |
|
|
Get the distance between a given plane and the origin |
|
Get the normal to the plane |
|
Get the nearest point to the origin on the plane |
Converts a 2D polar line to a conformal line |
|
Converts a 2D polar line to a conformal line |
|
Convert a 2D point to conformal |
|
Convert a 2D point to conformal |
|
|
Returns the euclidean distance between a point and a line |
Return the distance between a polar line and a euclidean point in 2D |
|
|
Gets the point that is maximally close to both lines Hadfield and Lasenby AGACSE2018 |
Gets the point that is maximally close to both lines Hadfield and Lasenby AGACSE2018 |
|
|
Gets a center point of a line cluster Hadfield and Lasenby AGACSE2018 |
Gets a center point of a line cluster Hadfield and Lasenby AGACSE2018 |
|
Gets an approximate center point of a line cluster Hadfield and Lasenby AGACSE2018 |
|
|
Gets the point of intersection of two orthogonal lines that meet Xdd = Ldd*no*Ldd + no Xddd = L3*Xdd*L3 Pd = 0.5*(Xdd+Xddd) P = -(Pd*ninf*Pd)(1)/(2*(Pd|einf)**2)[0] |
Gets the point of intersection of two orthogonal lines that meet Xdd = Ldd*no*Ldd + no Xddd = L3*Xdd*L3 Pd = 0.5*(Xdd+Xddd) P = -(Pd*ninf*Pd)(1)/(2*(Pd|einf)**2)[0] |
|
|
Takes a load of points and projects them onto a plane |
|
Takes a load of points and projects them onto a sphere |
|
Takes a load of point and projects them onto a circle The closest flag determines if it should be the closest or furthest point on the circle |
|
Takes a load of points and projects them onto a line |
Misc¶
The meet algorithm as described in “A Covariant Approach to Geometry” I5*((I5*A) ^ (I5*B)) |
|
|
The meet algorithm as described in “A Covariant Approach to Geometry” I5*((I5*A) ^ (I5*B)) |
Normalises a conformal point so that it has an inner product of -1 with einf |
|
Normalises a conformal point so that it has an inner product of -1 with einf |
|
Applies rotor to multivector in a fast way - JITTED |
|
|
Applies rotor to multivector in a fast way |
Applies rotor to multivector in a fast way takes pre computed adjoint |
|
|
Applies rotor to multivector in a fast way takes pre computed adjoint |
|
Returns the distance between two conformal points |
Convenience function for multiplication with ninf |
|
Returns sqrt(abs(~A*A)) |
|
|
Returns sqrt(abs(~A*A)) |
Returns A/sqrt(abs(~A*A)) |
|
|
fast version of the normal() function |
Fast jitted up mapping |
|
|
Fast up mapping |
A fast, jitted version of normalInv |
|
A fast, jitted version of homo() |
|
A fast, jitted version of down() |
|
|
A fast version of down() |
Fast dual |
|
|
Fast dual |
|
Disturbs an object by a random rotor |
fast grade projection |
|
|
Generates the matrix that sums the reflection of a point in many lines |
Generates the matrix that sums the reflection of a point in many lines |
|
Generates the truncated matrix that sums the reflection of a point in many lines n_power should be 1 or a power of 2 |
|
Takes an input multivector and returns what kind of object it is -1 -> not a blade 0 -> a 1 vector but not a point 1 -> a euclidean point 2 -> a conformal point 3 -> a point pair 4 -> a circle 5 -> a line 6 -> a sphere 7 -> a plane |
|
Takes in a TR rotor extracts the R and T normalises the T to unit displacement magnitude rebuilds the TR rotor with the new displacement rotor returns the new TR and the original length of the T rotor |
|
|
Takes in a TR rotor and a scale extracts the R and T scales the T displacement magnitude by scale rebuilds the TR rotor with the new displacement rotor returns the new TR rotor |
Root Finding¶
Square Root of Rotors - Implements the norm of a rotor |
|
Square Root of Rotors - Checks for a positive root |
|
Square Root of Rotors - Checks for a positive root |
|
Square Root of Rotors - Checks for a negative root |
|
Square Root of Rotors - Checks for a negative root |
|
Square Root of Rotors - Checks for a infinite roots |
|
|
Square Root of Rotors - Checks for a infinite roots |
Square Root of Rotors - Evaluates the positive root Square Root of Rotors - Evaluates the positive root |
|
Square Root of Rotors - Evaluates the positive root |
|
|
Square Root of Rotors - Evaluates the positive root |
|
Square Root of Rotors - Evaluates the negative root |
Square Root and Logarithm of Rotors in 3D Conformal Geometric Algebra Using Polar Decomposition Leo Dorst and Robert Valkenburg |
|
|
The general case of the root of a grade 0, 4 multivector |
Removes K from C = KX via (K[0] - K[4])*C |
|
|
Removes K from C = KX via (K[0] - K[4])*C |
Square Root and Logarithm of Rotors in 3D Conformal Geometric Algebra Using Polar Decomposition Leo Dorst and Robert Valkenburg |
|
Square Root and Logarithm of Rotors in 3D Conformal Geometric Algebra Using Polar Decomposition Leo Dorst and Robert Valkenburg |
|
Square Root and Logarithm of Rotors in 3D Conformal Geometric Algebra Using Polar Decomposition Leo Dorst and Robert Valkenburg |
|
Square Root and Logarithm of Rotors in 3D Conformal Geometric Algebra Using Polar Decomposition Leo Dorst and Robert Valkenburg |
|
Square Root and Logarithm of Rotors in 3D Conformal Geometric Algebra Using Polar Decomposition Leo Dorst and Robert Valkenburg |
|
|
Takes the n_th root of rotor R n must be a power of 2 |
|
Hadfield and Lasenby, Direct Linear Interpolation of Geometric Objects, AGACSE2018 Directly linearly interpolates conformal objects Return a valid object from the addition result C |
|
Hadfield and Lasenby, Direct Linear Interpolation of Geometric Objects, AGACSE2018 This is a general interpolation through the |
|
Hadfield and Lasenby, Direct Linear Interpolation of Geometric Objects, AGACSE2018 Directly averages conformal objects Return a valid object from the addition result C |
Hadfield and Lasenby, Direct Linear Interpolation of Geometric Objects, AGACSE2018 Directly averages conformal objects Return a valid object from the addition result C |
|
Hadfield and Lasenby, Direct Linear Interpolation of Geometric Objects, AGACSE2018 Directly averages conformal objects Return a valid object from the addition result C |
|
|
Lasenby and Hadfield AGACSE2018 For any two conformal objects X1 and X2 this returns a rotor that takes X1 to X2 Return a valid object from the addition result 1 + gamma*X2X1 |
Lasenby and Hadfield AGACSE2018 For any two conformal objects X1 and X2 this returns a rotor that takes X1 to X2 Uses the square root of rotors for efficiency and numerical stability |
|
Lasenby and Hadfield AGACSE2018 For any two conformal objects X1 and X2 this returns a rotor that takes X1 to X2 |
|
|
Lasenby and Hadfield AGACSE2018 For any two conformal objects X1 and X2 this returns a factor that corrects the X1 + X2 back to a blade |
Implements a very optimised rotor line to line extraction |
|
|
return the rotor between two lines |
|
return the rotor between two planes |
return the rotor between two planes |
Functions
|
Calculate the TRS rotor between any pair of rounds of the same grade Bring rounds to origin, line up carriers, calculate scale |
|
Removes K from C = KX via (K[0] - K[4])*C |
|
Applies rotor to multivector in a fast way |
|
Applies rotor to multivector in a fast way takes pre computed adjoint |
|
Hadfield and Lasenby, Direct Linear Interpolation of Geometric Objects, AGACSE2018 Directly averages conformal objects Return a valid object from the addition result C |
|
Lasenby and Hadfield AGACSE2018 For any two conformal objects X1 and X2 this returns a factor that corrects the X1 + X2 back to a blade |
|
Square Root of Rotors - Checks for a infinite roots |
Square Root of Rotors - Checks for a negative root |
|
Square Root of Rotors - Checks for a positive root |
|
returns the sphere for which the input circle is the perimeter |
|
|
Given a circle C and line L this calculates the closest points on each of them to the other |
|
Given two circles C1 and C2 this calculates the closest points on each of them to the other |
Convert a 2D point to conformal |
|
Converts a 2D polar line to a conformal line |
|
Return the distance between a polar line and a euclidean point in 2D |
|
|
Disturbs an object by a random rotor |
|
For a given set of spheres this finds a sphere that encloses all of them Tries to find the smallest one it can |
|
Returns the distance between two conformal points |
|
A fast version of down() |
|
Fast dual |
|
Fast up mapping |
|
Given two circles C1 and C2 this calculates the closest points on each of them to the other |
|
Hadfield and Lasenby, Direct Linear Interpolation of Geometric Objects, AGACSE2018 This is a general interpolation through the |
|
The general case of the root of a grade 0, 4 multivector |
|
Generates a rotor that performs dilation about the origin |
|
Creates n_clusters of random objects |
|
Creates a cluster of random objects |
|
Generates a rotor that translates objects along the euclidean vector euc_vector_a |
|
Returns the conformal point at the centre of a sphere by reflecting the point at infinity |
|
Extracts all the normal stuff for a circle |
|
Gets the point of intersection of two orthogonal lines that meet Xdd = Ldd*no*Ldd + no Xddd = L3*Xdd*L3 Pd = 0.5*(Xdd+Xddd) P = -(Pd*ninf*Pd)(1)/(2*(Pd|einf)**2)[0] |
|
Generates the matrix that sums the reflection of a point in many lines |
|
Get the nearest point to the origin on the plane |
|
Get the normal to the plane |
|
Get the distance between a given plane and the origin |
|
Returns the radius of a sphere |
|
Hadfield and Lasenby, Direct Linear Interpolation of Geometric Objects, AGACSE2018 Directly linearly interpolates conformal objects Return a valid object from the addition result C |
Takes an input multivector and returns what kind of object it is -1 -> not a blade 0 -> a 1 vector but not a point 1 -> a euclidean point 2 -> a conformal point 3 -> a point pair 4 -> a circle 5 -> a line 6 -> a sphere 7 -> a plane |
|
|
Returns the point at the intersection of a line and plane If there is no intersection it returns None |
|
Find the smallest sphere that encloses both spheres |
|
|
converts a line to the conformal nearest point to the origin and a euc direction vector in direction of the line |
|
|
The meet algorithm as described in “A Covariant Approach to Geometry” I5*((I5*A) ^ (I5*B)) |
|
Gets the point that is maximally close to both lines Hadfield and Lasenby AGACSE2018 |
|
Gets a center point of a line cluster Hadfield and Lasenby AGACSE2018 |
|
Calculates a motor that takes X1 to X2 |
|
Calculate the motor between any pair of rounds of the same grade Line up the carriers, then line up the centers |
|
Takes the n_th root of rotor R n must be a power of 2 |
Square Root and Logarithm of Rotors in 3D Conformal Geometric Algebra Using Polar Decomposition Leo Dorst and Robert Valkenburg |
|
|
Square Root of Rotors - Evaluates the negative root |
|
Returns sqrt(abs(~A*A)) |
Takes in a TR rotor extracts the R and T normalises the T to unit displacement magnitude rebuilds the TR rotor with the new displacement rotor returns the new TR and the original length of the T rotor |
|
Normalises a conformal point so that it has an inner product of -1 with einf |
|
|
fast version of the normal() function |
|
Check if the point is fully beyond the plane in the direction of the plane normal |
Extracts the end points of a point pair bivector |
|
Square Root and Logarithm of Rotors in 3D Conformal Geometric Algebra Using Polar Decomposition Leo Dorst and Robert Valkenburg |
|
|
Square Root of Rotors - Evaluates the positive root |
|
Takes a load of point and projects them onto a circle The closest flag determines if it should be the closest or furthest point on the circle |
|
Takes a load of points and projects them onto a line |
|
Takes a load of points and projects them onto a plane |
|
Takes a load of points and projects them onto a sphere |
|
Takes in a quaternion and a vector and returns a conformal rotor that implements the transformation |
Creates a random bivector on the form described by R. |
|
Creates a random circle |
|
Creates a random circle at the origin |
|
|
Creates a random conformal point |
Creates a random line |
|
Creates a random line at the origin |
|
Creates a random plane |
|
Creates a random plane at the origin |
|
Creates a random point pair bivector object |
|
Creates a random point pair bivector object at the origin |
|
generate a random combined rotation and translation rotor |
|
Creates a random sphere |
|
Creates a random sphere at the origin |
|
|
generate a random translation rotor |
|
|
|
return the rotor between two lines |
|
Lasenby and Hadfield AGACSE2018 For any two conformal objects X1 and X2 this returns a rotor that takes X1 to X2 Return a valid object from the addition result 1 + gamma*X2X1 |
|
return the rotor between two planes |
|
Takes in a TR rotor and a scale extracts the R and T scales the T displacement magnitude by scale rebuilds the TR rotor with the new displacement rotor returns the new TR rotor |
|
Check if the sphere is fully behind the plane in the direction of the plane normal, ie the opposite of sphere_beyond_plane |
|
Check if the sphere is fully beyond the plane in the direction of the plane normal |
|
Checks if one sphere is inside the other (S1|S2)[0] < -1 |
|
Checks for intersection between a sphere and a line |
Square Root and Logarithm of Rotors in 3D Conformal Geometric Algebra Using Polar Decomposition Leo Dorst and Robert Valkenburg |
|
Creates a standard line at the origin |
|
Creates a standard point pair at the origin |
|
|
Normalises the sign of a sphere |
Converts a 2D polar line to a conformal line |
|
|
Returns the euclidean distance between a point and a line |
|
Normalises the sign of a sphere |
Classes
|
This class is for storing arrays of conformal multivectors |