---
title: "screenCoordinates(physicalCoordinates:layer:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlrasterizationratemap/screencoordinates(physicalcoordinates:layer:)"
---

# screenCoordinates(physicalCoordinates:layer:)

Converts a point in physical coordinates inside a layer to its corresponding logical viewport coordinates.

## Declaration

```swift
func screenCoordinates(physicalCoordinates: MTLCoordinate2D, layer layerIndex: Int) -> MTLCoordinate2D
```

## Parameters

- `physicalCoordinates`: A point in layer coordinates.
- `layerIndex`: The index of the rate map to use.

## Return Value

Return Value A point in the view coordinates corresponding to the source point.

## Discussion

Discussion The returned coordinates are always greater than or equal to the input coordinates because the rasterization rate never exceeds 1:1 in any region.

## See Also

### Converting between viewport and physical coordinates

- [physicalCoordinates(screenCoordinates:layer:)](metal/mtlrasterizationratemap/physicalcoordinates(screencoordinates:layer:).md)
