Skip to main content
3-Newcomer
April 20, 2011
Solved

Help for a VBA-->Mathcad program

  • April 20, 2011
  • 1 reply
  • 6718 views

Hello! I need to transform a short program from Visual basic to Mathcad. The algorithm is for determination whether point lies inside or outside of polygon. I have written program in Mathcad, but according to the result - incorrectly. Please help.

thanks in advance

Rosen

Best answer by StuartBruff

Rosen Mitrev wrote:

Hello! I need to transform a short program from Visual basic to Mathcad. The algorithm is for determination whether point lies inside or outside of polygon. I have written program in Mathcad, but according to the result - incorrectly. Please help.

thanks in advance

Rosen

I haven't checked your program in detail, Rosen, but it seems to work when given a (closed) square to deal with.

I've given an alternative implementation using 'continue' rather than nested if statements. This allows an implementation that is closer to the original. I've also a set of test points that track through the polygon.

Stuart

1 reply

23-Emerald V
April 20, 2011

Rosen Mitrev wrote:

Hello! I need to transform a short program from Visual basic to Mathcad. The algorithm is for determination whether point lies inside or outside of polygon. I have written program in Mathcad, but according to the result - incorrectly. Please help.

thanks in advance

Rosen

I haven't checked your program in detail, Rosen, but it seems to work when given a (closed) square to deal with.

I've given an alternative implementation using 'continue' rather than nested if statements. This allows an implementation that is closer to the original. I've also a set of test points that track through the polygon.

Stuart

23-Emerald V
April 20, 2011

... forgot to add.

I removed the image of the VBA code to reduce the file size.

I haven't checked it as don't have time ... so, caveat emptor!!

3-Newcomer
April 21, 2011

Stuart, thanks again! Except you are Mathcad expert, i saw you achievments in Russian (at russian Mathcad forum),Bulgarian, and Latin languages and I am impressed:)
I think your program will be helpfull for other users, because i didn't find in Internet any algorithm for point in polygon, programmed in Mathcad.
Пожелавам ви приятен празник!