CwPlane3d
src.cwmath.cwplane3d
CwPlane3d
Plane class for 3D planes.
Source code in src/cwmath/cwplane3d.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |
__call__(x, y, z)
Calculate the value of the plane at a given point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x |
float
|
x-coordinate of the point |
required |
y |
float
|
y-coordinate of the point |
required |
z |
float
|
z-coordinate of the point |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
value of the plane at the given point |
Source code in src/cwmath/cwplane3d.py
49 50 51 52 53 54 55 56 57 58 59 60 61 | |
distance_to_plane(other)
Calculates the distance from a plane to another plane.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other |
CwPlane3d
|
3d plane |
required |
Returns:
| Type | Description |
|---|---|
float
|
distance to plane |
Source code in src/cwmath/cwplane3d.py
172 173 174 175 176 177 178 179 180 181 182 | |
distance_to_point(point)
Calculates the distance from a point to the plane. The distance from a point to a plane is given by the formula: |ax + by + cz + d| / sqrt(a^2 + b^2 + c^2) where (a, b, c) is the normal vector of the plane, (x, y, z) are the coordinates of the point, and d is the constant term in the plane equation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point |
CwVector3d
|
point |
required |
Returns:
| Type | Description |
|---|---|
float
|
distance from the point to the plane |
Source code in src/cwmath/cwplane3d.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
is_coplanar(other)
Checks if two planes are coplanar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other |
CwPlane3d
|
3d plane |
required |
Returns:
| Type | Description |
|---|---|
bool
|
if the planes are coplanar |
Source code in src/cwmath/cwplane3d.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
is_parallel(other)
Checks if two planes are parallel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other |
CwPlane3d
|
3d plane |
required |
Returns:
| Type | Description |
|---|---|
bool
|
if the planes are parallel |
Source code in src/cwmath/cwplane3d.py
97 98 99 100 101 102 103 104 105 106 107 108 | |
is_perpendicular(other)
Checks if two planes are perpendicular.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other |
CwPlane3d
|
3d plane |
required |
Returns:
| Type | Description |
|---|---|
bool
|
if the planes are perpendicular |
Source code in src/cwmath/cwplane3d.py
110 111 112 113 114 115 116 117 118 119 120 | |
is_point_on_plane(point)
Checks if a point is on the plane.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point |
CwVector3d
|
point |
required |
Returns:
| Type | Description |
|---|---|
bool
|
if the point is on the plane |
Source code in src/cwmath/cwplane3d.py
142 143 144 145 146 147 148 149 150 151 152 | |