anastruct.basic =============== .. py:module:: anastruct.basic Exceptions ---------- .. autoapisummary:: anastruct.basic.FEMException Functions --------- .. autoapisummary:: anastruct.basic.find_nearest anastruct.basic.integrate_array anastruct.basic.arg_to_list anastruct.basic.rotation_matrix anastruct.basic.rotate_xy Module Contents --------------- .. py:function:: find_nearest(array: numpy.ndarray, value: float) -> Tuple[float, int] Find the nearest value in an array Args: array (np.ndarray): array to search within value (float): value to search for Returns: Tuple[float, int]: Nearest value, index .. py:function:: integrate_array(y: numpy.ndarray, dx: float) -> numpy.ndarray Integrate an array y*dx using the trapezoidal rule Args: y (np.ndarray): Array to integrate dx (float): Step size Returns: np.ndarray: Integrated array .. py:exception:: FEMException(type_: str, message: str) Bases: :py:obj:`Exception` Common base class for all non-exit exceptions. .. py:attribute:: type .. py:attribute:: message .. py:function:: arg_to_list(arg: Any, n: int) -> list Convert an argument to a list of length n Args: arg (Any): Argument to convert n (int): Length of list to create Returns: list: List of length n .. py:function:: rotation_matrix(angle: float) -> numpy.ndarray Create a 2x2 rotation matrix Args: angle (float): Angle in radians Returns: np.ndarray: 2x2 Euclidean rotation matrix .. py:function:: rotate_xy(a: numpy.ndarray, angle: float) -> numpy.ndarray Rotate a 2D matrix around the origin Args: a (np.ndarray): Matrix to rotate angle (float): Angle in radians Returns: np.ndarray: Rotated matrix