Im trying to do a simulation using Matlab to solve some fluid problem. For this problem I have the following shape:

enter image description here

For each black point I know the (x,y) coordinates.

I need to find the coordinates of the blue points which are located at 75% of the x coordinate between each two black dots and at the middle between the y coordinate of each two black dots.

I have been trying for a while but cant find simple method.

If someone can help with the logic/some code it will be much appreciated.

Thank you.

  • $\begingroup$ I'm guessing your description of where the blue point are is unclear, because you already described it with a formula, and you can directly use that formula (i.e. add up the y-coordiantes and divide by 2). $\endgroup$ – Todor Markov Nov 30 '18 at 21:03
  • $\begingroup$ I know where the blue point should be, however when thinking about the problem as problem with above 1000 points I cant figure out the iterative formula $\endgroup$ – Ben Nov 30 '18 at 21:07

You can use standard isoparametric representation. For example, use the formula from slides 21 and 22 from http://www.rpi.edu/~des/Isoparametric.ppt

In your case for $(x_{i},y_{i})$, start with co-ordinate for top left corner for $(x_{1}, y_{1})$ and go counter-clockwise for the next three. Use $s=0.5$ and $t=0$ in the formulas below.

$$ x = \sum_{i} N_{i}(s,t) x_{i} $$ $$ y = \sum_{i} N_{i}(s,t) y_{i} $$ $$ \begin{matrix} N_{1}(s,t) & = & (1-s)(1-t)/4 \\ N_{2}(s,t) & = & (1+s)(1-t)/4 \\ N_{3}(s,t) & = & (1+s)(1+t)/4 \\ N_{4}(s,t) & = & (1-s)(1+t)/4 \end{matrix} $$

  • $\begingroup$ I would type the equations. You never know when the link becomes invalid $\endgroup$ – Andrei Nov 30 '18 at 22:11
  • $\begingroup$ It works thank you very much. Can you please just explain what the s and t means? $\endgroup$ – Ben Nov 30 '18 at 22:50
  • $\begingroup$ The quadrilateral is mapped into a square with co-ordinates $(-1,-1), (1,-1), (1,1), (-1,1)$. $s$ and $t$ are the co-ordinates in this square. For mid-point in $y$, $t=0$. For $3/4$ point in $x$, $s=0.5$. You can download the power point for more details. This mapping technique is used in finite element analysis. $\endgroup$ – boidy Nov 30 '18 at 23:17
  • $\begingroup$ Thats an awesome answer, that you very much $\endgroup$ – Ben Nov 30 '18 at 23:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.