Click here to Skip to main content
16,014,591 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: XSLT in VC++ Pin
vinay_K29-Jul-08 1:47
vinay_K29-Jul-08 1:47 
GeneralRe: XSLT in VC++ Pin
CPallini29-Jul-08 1:53
mveCPallini29-Jul-08 1:53 
GeneralRe: XSLT in VC++ Pin
vinay_K29-Jul-08 2:04
vinay_K29-Jul-08 2:04 
GeneralRe: XSLT in VC++ Pin
CPallini29-Jul-08 8:16
mveCPallini29-Jul-08 8:16 
QuestionDetermining if a GPS point is inside a polygon Pin
AaronM_NZ29-Jul-08 0:56
AaronM_NZ29-Jul-08 0:56 
AnswerRe: Determining if a GPS point is inside a polygon Pin
Iain Clarke, Warrior Programmer29-Jul-08 23:43
Iain Clarke, Warrior Programmer29-Jul-08 23:43 
GeneralRe: Determining if a GPS point is inside a polygon Pin
AaronM_NZ30-Jul-08 14:34
AaronM_NZ30-Jul-08 14:34 
AnswerRe: Determining if a GPS point is inside a polygon Pin
CPallini30-Jul-08 3:13
mveCPallini30-Jul-08 3:13 
wormer90 wrote:
' -1 IF THE POINT IS OUTSIDE OF THE POLYGON,


The above is wrong: it is a misinterpretation of the C original routine
(please read carefully the page linked in your post).


The following VBScript code (sorry no VB6 available here) works for me (though I didn't test it extensively) returning true whenever the point is inside the polygon.
dim vertx(6), verty(6)
vertx(0) = 2
verty(0) = 2
vertx(1) = 5
verty(1) = 1
vertx(2) = 8
verty(2) = 2
vertx(3) = 7
verty(3) = 4
vertx(4) = 8
verty(4) = 6
vertx(5) = 1
verty(5) = 7
testx = 3
testy = 3
nvert = 6
c = false
i = 0
j = nvert - 1
Do
  if (verty(i) > testy) <> (verty(j) > testy) Then
    if (testx < (vertx(j)-vertx(i)) * (testy-verty(i)) / (verty(j)-verty(i)) + vertx(i))   then
      c = Not c
    end if
  end if
  j = i
  i = i + 1
Loop while i < nvert
MsgBox "result = " & c

Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke


[My articles]

GeneralRe: Determining if a GPS point is inside a polygon Pin
AaronM_NZ30-Jul-08 14:40
AaronM_NZ30-Jul-08 14:40 
GeneralYou are welcome Pin
CPallini30-Jul-08 20:52
mveCPallini30-Jul-08 20:52 
QuestionAbout C++ on different OS? Pin
ritz123429-Jul-08 0:35
ritz123429-Jul-08 0:35 
AnswerRe: About C++ on different OS? Pin
Cedric Moonen29-Jul-08 0:49
Cedric Moonen29-Jul-08 0:49 
GeneralRe: About C++ on different OS? Pin
toxcct29-Jul-08 0:57
toxcct29-Jul-08 0:57 
GeneralRe: About C++ on different OS? Pin
Cedric Moonen29-Jul-08 2:03
Cedric Moonen29-Jul-08 2:03 
JokeRe: About C++ on different OS? [THHB attempt] Pin
Rajesh R Subramanian29-Jul-08 2:32
professionalRajesh R Subramanian29-Jul-08 2:32 
JokeRe: About C++ on different OS? [THHB attempt] Pin
Cedric Moonen29-Jul-08 4:05
Cedric Moonen29-Jul-08 4:05 
GeneralRe: About C++ on different OS? [THHB attempt] Pin
Rajesh R Subramanian29-Jul-08 21:24
professionalRajesh R Subramanian29-Jul-08 21:24 
AnswerRe: About C++ on different OS? Pin
toxcct29-Jul-08 0:52
toxcct29-Jul-08 0:52 
AnswerRe: About C++ on different OS? Pin
CPallini29-Jul-08 0:53
mveCPallini29-Jul-08 0:53 
AnswerRe: About C++ on different OS? Pin
vikas amin30-Jul-08 11:08
vikas amin30-Jul-08 11:08 
QuestionRunTime Error : The instruction at "0x00000000" referenced memory at "0x00000000". The memory could not be "read". Pin
ptr_Electron29-Jul-08 0:33
ptr_Electron29-Jul-08 0:33 
AnswerRe: RunTime Error : The instruction at "0x00000000" referenced memory at "0x00000000". The memory could not be "read". Pin
Cedric Moonen29-Jul-08 0:47
Cedric Moonen29-Jul-08 0:47 
AnswerRe: RunTime Error : The instruction at "0x00000000" referenced memory at "0x00000000". The memory could not be "read". Pin
Joe Woodbury29-Jul-08 8:57
professionalJoe Woodbury29-Jul-08 8:57 
QuestionDialog as MDI mainframe window ? Pin
jalsa G29-Jul-08 0:01
jalsa G29-Jul-08 0:01 
QuestionRe: Dialog as MDI mainframe window ? Pin
CPallini29-Jul-08 0:31
mveCPallini29-Jul-08 0:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.