Hello All,

I am stuck to an problem, in which i have to clip or split an polygon one the basis of divider line.

It may be an easy math for an expert. But i am not good in that

These are my polygon point

- 0: Vector3 {x: 0.42379530531678655, y: 0.001, z: 0.3513340397769077}
- 1: Vector3 {x: -0.29115869753800094, y: 0.001, z: 0.34800867212540565}
- 2: Vector3 {x: -0.3676420596677825, y: 0.001, z: 0.8069092762673487}
- 3: Vector3 {x: 0.5268815283072485, y: 0.001, z: 0.8069092762673488}

They are responsible for creating an rectangle like this

So what i need is , a function what can split my polygon into two part and polygon can be any shape.

To split i can draw a line that i know how to do and i have end points of the line but here i only need a Math that help to split my shape for example a rectangle into two rectangle.

Please provide help

Thanks