Module nlisim.geometry.math_function
Expand source code
import numpy as np
from nlisim.coordinates import Point
class Sphere:
def __init__(self, center: np.ndarray, radius: float, type: str):
self.center = Point(x=center[0], y=center[1], z=center[2])
self.radius = radius
self.type = type
def scale(self, n):
self.radius *= n
self.center.x *= n
self.center.y *= n
self.center.z *= n
class Cylinder:
def __init__(
self, center: np.ndarray, direction: np.ndarray, radius: float, length: float, type: str
):
self.center = Point(x=center[0], y=center[1], z=center[2])
self.direction = np.asarray(direction)
self.radius = radius
self.length = length
self.type = type
def scale(self, n):
self.radius *= n
self.center.x *= n
self.center.y *= n
self.center.z *= n
self.length *= n
Classes
class Cylinder (center: numpy.ndarray, direction: numpy.ndarray, radius: float, length: float, type: str)
-
Expand source code
class Cylinder: def __init__( self, center: np.ndarray, direction: np.ndarray, radius: float, length: float, type: str ): self.center = Point(x=center[0], y=center[1], z=center[2]) self.direction = np.asarray(direction) self.radius = radius self.length = length self.type = type def scale(self, n): self.radius *= n self.center.x *= n self.center.y *= n self.center.z *= n self.length *= n
Methods
def scale(self, n)
-
Expand source code
def scale(self, n): self.radius *= n self.center.x *= n self.center.y *= n self.center.z *= n self.length *= n
class Sphere (center: numpy.ndarray, radius: float, type: str)
-
Expand source code
class Sphere: def __init__(self, center: np.ndarray, radius: float, type: str): self.center = Point(x=center[0], y=center[1], z=center[2]) self.radius = radius self.type = type def scale(self, n): self.radius *= n self.center.x *= n self.center.y *= n self.center.z *= n
Methods
def scale(self, n)
-
Expand source code
def scale(self, n): self.radius *= n self.center.x *= n self.center.y *= n self.center.z *= n