I would like to find the intersection points e.g. $M_x$ and $M_y$ as in the attached figure. The boundary (solid line) is defined by the Lagrangian points. I am working in C++ (basic - medium proficiency).

In this regard, I need a computer algorithm or code to get the intersection points both in x- and y-in a separate arrays.

enter image description here

  • $\begingroup$ Is the boundary defined analytically or how is defined? Can you use marching squares? $\endgroup$ – nicoguaro Jun 28 '16 at 4:07
  • $\begingroup$ The boundary is defined parametrically, e,g, if we assume a circular boundary, the parametric equations to compute x and y-coordinates of the boundary are: $x = x_{center} + radius*cos(\theta)$ and $y = y_{center} + radius*sin(\theta)$ where $\theta = \pi*index/N_{pts}$. However, the points/boundary can be defined as an input file with a pre-calculated coordinates. $\endgroup$ – TheCoder Jun 28 '16 at 5:24
  • $\begingroup$ @nicoguaro: Can you give the minimal algorithm for the particular problem under question using Marching Squares? One thing, boundary is moving with time and at each time step position is determined and updated. $\endgroup$ – TheCoder Jun 30 '16 at 9:35
  • $\begingroup$ I don't have it. You should probably get the signed function for you curve, then apply the marching squares algorithm. You can repeat the process for each timestep $\endgroup$ – nicoguaro Jun 30 '16 at 14:22

Your Answer

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

Browse other questions tagged or ask your own question.