<p>One solution is bilinear mapping, which works for every convex quadrilateral.</p>

<p>Let $A, B, C, D$ be the vertices of a quadrilateral $Q$ in the plane, in this order.</p>

<p>Then $f(u,v)=(1-u)(1-v)A + u(1-v)B + uvC + (1-u)vD$ maps the square $[0,1] \times [0,1]$ to $Q$.</p>

<p><a href="https://i.sstatic.net/DKYWs.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/DKYWs.png" alt="enter image description here"></a>
<a href="https://i.sstatic.net/3OIsg.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/3OIsg.png" alt="enter image description here"></a></p>

CC BY-SA 3.0
2015-09-13T14:24:25.790Z
What, [no MathJax](http://meta.computergraphics.stackexchange.com/questions/18/should-we-have-mathjax-support) ? :-(
lhf
CC BY-SA 3.0
2015-09-13T18:09:00.987Z
Yep, looks like it's not working yet :(. Would you mind just using plain code formatting for time being, so all those symbols won't distract from the formulas?
glampert
CC BY-SA 3.0
2015-09-14T13:37:44.347Z
I've added this question to the [list of examples on meta](http://meta.computergraphics.stackexchange.com/questions/18/should-we-have-mathjax-support) to add to the case for adding MathJax to our site.
trichoplax is on Codidact now
CC BY-SA 3.0
2015-09-14T13:45:54.443Z
"which works for _every quadrilateral_." Unless I've messed up my "back of the envelope sketch", I think you need to amend that to "every _convex_ quadrilateral".
Simon F
CC BY-SA 3.0
2015-11-03T15:13:15.963Z
@ratchet, MathJax, yeah!
lhf
CC BY-SA 3.0
2015-09-13T14:24:06.633Z
2015-11-03T15:12:26.733Z
2015-11-03T15:12:26.733Z
lhf
<p>How do I go about defining this area without using a piecewise function?</p>

<p>I think it has something to do with Bilinear Surfaces but I'm not sure how to get started.</p>

<p><a href="https://i.sstatic.net/MpA53.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/MpA53.png" alt="Graph showing an area composed of a square region adjoining a triangular region"></a></p>

CC BY-SA 3.0
2015-09-13T12:35:40.917Z
What kind of properties are you after for that surface?
joojaa
<computational-geometry>
Two-dimensional bounded area defined parametrically
Gavin
# Two-dimensional bounded area defined parametrically

(Asked by: username_0 on 2015-09-13)

How do I go about defining this area without using a piecewise function?

I think it has something to do with Bilinear Surfaces but I'm not sure how to get started.

[![Graph showing an area composed of a square region adjoining a triangular region](https://i.sstatic.net/MpA53.png)](https://i.sstatic.net/MpA53.png)

**Tags:** computational-geometry

> **Comments:**
> **username_1**: What kind of properties are you after for that surface?  

---

## 1 answers

### Answer by username_2 on 2015-09-13. Score: 4

One solution is bilinear mapping, which works for every convex quadrilateral.

Let $A, B, C, D$ be the vertices of a quadrilateral $Q$ in the plane, in this order.

Then $f(u,v)=(1-u)(1-v)A + u(1-v)B + uvC + (1-u)vD$ maps the square $[0,1] \times [0,1]$ to $Q$.

[![enter image description here](https://i.sstatic.net/DKYWs.png)](https://i.sstatic.net/DKYWs.png)
[![enter image description here](https://i.sstatic.net/3OIsg.png)](https://i.sstatic.net/3OIsg.png)

> **Comments:**
> **username_2**: What, [no MathJax](http://meta.computergraphics.stackexchange.com/questions/18/should-we-have-mathjax-support) ? :-(  
> **username_3**: Yep, looks like it's not working yet :(. Would you mind just using plain code formatting for time being, so all those symbols won't distract from the formulas?  
> **username_4**: I've added this question to the [list of examples on meta](http://meta.computergraphics.stackexchange.com/questions/18/should-we-have-mathjax-support) to add to the case for adding MathJax to our site.  
> **username_5**: "which works for _every quadrilateral_." Unless I've messed up my "back of the envelope sketch", I think you need to amend that to "every _convex_ quadrilateral".  
> **username_2**: @ratchet, MathJax, yeah!  

---

