---
title: direction_to
description: Calculate the direction between the current location and a target location.
---

## Signature

```py
def direction_to(location: Location) -> Direction
```

## Description

Returns the `Direction` from the current location to the specified target `location`.  
The direction represents the cardinal or intercardinal direction that points from the
current location towards the target.  

## Example:

```py
start = Location(0, 0)
goal = Location(0, 5)
dir = start.direction_to(goal)
print(dir) # Output: Direction.NORTH
```
