# HorizontalToVerticalFieldOfView(float, float)

> Converts the horizontal field of view (FOV) to the vertical FOV, based on the value of the aspect ratio parameter.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static float HorizontalToVerticalFieldOfView(float horizontalFieldOfView, float aspectRatio)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The horizontal field of view value in degrees.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The aspect ratio value used for the conversion.

### Returns

| Type                                                          | Description                            |
| ------------------------------------------------------------- | -------------------------------------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | The vertical field of view in degrees. |

### Remarks

Additional Resources: [Camera.fieldOfView](/engine/6000.7/script-reference/unityengine/camera/fieldofview.md), [Camera.aspect](/engine/6000.7/script-reference/unityengine/camera/aspect.md), [Camera.VerticalToHorizontalFieldOfView](/engine/6000.7/script-reference/unityengine/camera/verticaltohorizontalfieldofview.md), [Camera.FieldOfViewToFocalLength](/engine/6000.7/script-reference/unityengine/camera/fieldofviewtofocallength.md), [Camera.FocalLengthToFieldOfView](/engine/6000.7/script-reference/unityengine/camera/focallengthtofieldofview.md).

### Examples

```csharp
using UnityEngine;

public class HorizontalFieldOfViewControl : MonoBehaviour
{
    public float horizontalFieldOfView = 60f;
    public Camera targetCamera;

    void Update()
    {
        targetCamera.fieldOfView = Camera.HorizontalToVerticalFieldOfView(horizontalFieldOfView, targetCamera.aspect);
    }
}
```
