---
title: "atan2(withPrimaryTensor:secondaryTensor:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/atan2(withprimarytensor:secondarytensor:name:)"
---

# atan2(withPrimaryTensor:secondaryTensor:name:)

Returns the elementwise two-argument arctangent of the input tensors.

## Declaration

```swift
func atan2(withPrimaryTensor primaryTensor: MPSGraphTensor, secondaryTensor: MPSGraphTensor, name: String?) -> MPSGraphTensor
```

## Parameters

- `primaryTensor`: The LHS tensor of the binary Op.
- `secondaryTensor`: The RHS tensor of the binary Op.
- `name`: An optional string which serves as an identifier for the operation.

## Return Value

Return Value A valid MPSGraphTensor object containing the elementwise result of the applied operation.

## Discussion

Discussion This operation creates a atan2 operation and returns the result tensor. It supports broadcasting as well. Graph computes arc tangent of primaryTensor over secondaryTensor. resultTensor = atan2(primaryTensor, secondaryTensor)
