> For the complete documentation index, see [llms.txt](https://jaywin.gitbook.io/leetcode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jaywin.gitbook.io/leetcode/solutions/0469-convex-polygon.md).

# 0469. Convex Polygon

<https://leetcode.com/problems/convex-polygon>

## Description

You are given an array of points on the **X-Y** plane `points` where `points[i] = [xi, yi]`. The points form a polygon when joined sequentially.

Return `true` if this polygon is [convex](http://en.wikipedia.org/wiki/Convex_polygon) and `false` otherwise.

You may assume the polygon formed by given points is always a [simple polygon](http://en.wikipedia.org/wiki/Simple_polygon). In other words, we ensure that exactly two edges intersect at each vertex and that edges otherwise don't intersect each other.

**Example 1:**

![](https://assets.leetcode.com/uploads/2021/04/09/covpoly1-plane.jpg)

```
**Input:** points = [[0,0],[0,5],[5,5],[5,0]]
**Output:** true
```

**Example 2:**

![](https://assets.leetcode.com/uploads/2021/04/09/covpoly2-plane.jpg)

```
**Input:** points = [[0,0],[0,10],[10,10],[10,0],[5,5]]
**Output:** false
```

**Constraints:**

* `3 <= points.length <= 104`
* `points[i].length == 2`
* `-104 <= xi, yi <= 104`
* All the given points are **unique**.

## ac

```java
```
