Geometry¶
General geometry functions associated with unstructured triangular meshes and functions used within the WaveVal package.
- Dependencies [External]:
numpy
- Dependencies [Internal]:
- Geometry.cart2cmplx(x, y)[source]¶
Coordinate conversion: Cartesian to Complex
- Parameters:
x – Cartesian x-coord
y – Cartesian y-coord
- Returns:
cmplx
- Geometry.cart2pol(x, y)[source]¶
Coordinate conversion: Cartesian to Polar
- Parameters:
x – Cartesian x-coord
y – Cartesian y-coord
- Returns:
r
- Returns:
theta (in degrees)
- Geometry.cmplx2cart(c)[source]¶
Coordinate conversion: Complex to Cartesian
- Parameters:
c – complex numbers (x + jy)
- Returns:
x
- Returns:
y
- Geometry.cmplx2pol(x, angularUnits=0)[source]¶
Coordinate conversion: Complex to Polar
- Parameters:
x – complex numbers (x + jy)
anglularUnits – 0 = degress [default], 1 = radians
- Returns:
radii
- Returns:
angles
- Geometry.getBarycentricWeights(p1, p2, p3, p)[source]¶
Calculate Barycentric weights for interpolating data from the triangle node points p1, p2, p3 onto the point p.
- Geometry.getTriangleArea(p1, p2, p3)[source]¶
Calculate the area of a triangle defined by the points p1, p2, p3.
- Geometry.getTriangleCentroid(p1, p2, p3)[source]¶
Calculate the position of the centroid for a triangle defined by the points p1, p2, p3.
- Geometry.interpTriangle(p1, p2, p3, p, v1, v2, v3)[source]¶
Interpolate the values v1, v2, v3 from the triangle nodes defined by the points p1, p2, p3 onto the location p using the Barycentric wighting method.
- Geometry.isInsideTriangle(p1, p2, p3, p)[source]¶
Determine whether the point p lies within the triangle defined by the points p1, p2, p3.
- Geometry.pol2cart(r, theta)[source]¶
Coordinate conversion: Polar to Cartesian
- Parameters:
r – radial distance
theta – angle in degrees
- Returns:
x
- Returns:
y