IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo function

coord_transform

def coord_transform[mode: CoordinateTransformationMode](out_coord: Int, in_dim: Int, out_dim: Int, scale: Float32) -> Float32

Maps an output coordinate to an input coordinate according to the given transformation mode.

Parameters:

Args:

  • ​out_coord (Int): The output coordinate to map.
  • ​in_dim (Int): The size of the input dimension.
  • ​out_dim (Int): The size of the output dimension.
  • ​scale (Float32): The ratio of output dimension size to input dimension size.

Returns:

Float32: The corresponding input coordinate as a floating-point value.