---
name: "tickit_rect_intersect"
section: "3"
platform: "linux"
package: "libtickit-dev"
version: "0.4.3-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/tickit_rect_intersect"
---

# tickit\_rect\_intersect(3)

obtain the intersection of two rectangles

## NAME

tickit\_rect\_intersect - obtain the intersection of two rectangles

## SYNOPSIS

```
#include <tickit.h>

bool tickit_rect_intersect(TickitRect *dst,
     const TickitRect *a, const TickitRect *b);
```

Link with *-ltickit*.

## DESCRIPTION

**tickit\_rect\_intersect**() tests if the two rectangles given by *a* and *b* intersect and if so, initialises the rectangle structure given by *dst* to contain it. It returns true if it did this. If the two given rectangles do not intersect then it returns false and does not modify the structure given by *dst*.

*dst* may be equal to either *a* or *b*, or it may refer to a distinct rectangle structure. The two source rectangles are read before the result is written.

To simply test if two given rectangles intersect without obtaining the actual intersection region, use [**tickit\_rect\_intersects**(3)](/tickit_rect_intersects/3.md).

## RETURN VALUE

**tickit\_rect\_intersect**() returns true if the rectangles intersect, and false if not.

## SEE ALSO

[**tickit\_rect\_init\_sized**(3)](/tickit_rect_init_sized/3.md), [**tickit\_rect\_init\_bounded**(3)](/tickit_rect_init_bounded/3.md), [**tickit\_rect\_intersects**(3)](/tickit_rect_intersects/3.md), [**tickit\_rect\_add**(3)](/tickit_rect_add/3.md), [**tickit\_rect\_subtract**(3)](/tickit_rect_subtract/3.md), [**tickit\_rect**(7)](/tickit_rect/7.md), [**tickit**(7)](/tickit/7.md)
