coordinates.coordinate_systems.CartesianCoordinateSystem2D.metric_tensor#
- property CartesianCoordinateSystem2D.metric_tensor: Callable#
Returns the callable function for the metric tensor of the coordinate system.
The (diagonal components of the) metric tensor \(g_{ii}\) defines the inner product structure of the coordinate system. It is used for measuring distances, computing derivatives, and raising/lowering indices. This function returns the precomputed metric tensor as a callable function, which can be evaluated at specific coordinates.
- Returns:
A function that computes the metric tensor \(g_{ii}\) when evaluated at specific coordinates. The returned function takes numerical coordinate values as inputs and outputs a NumPy array of shape
(ndim, )
.- Return type:
Callable
Example
cs = MyCoordinateSystem() g_ii = cs.metric_tensor(x=1, y=2, z=3) # Evaluates the metric at (1,2,3) print(g_ii.shape) # Output: (ndim, )