0% found this document useful (0 votes)
125 views2 pages

Pseudocode Calculation

Uploaded by

api-280451617
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
125 views2 pages

Pseudocode Calculation

Uploaded by

api-280451617
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

/////////////////////////////////////////////////

PUBLIC FUNCTION InitField


RECEIVE: 8 integers represents the 4 corners' coordinates
calculate and set coordinates for the corners
calculate and set the slope and intercept of the lines that
define the field
calculate and set all the targets for different regions
calculate and set all the Boundary vectors for direction calculation
endInitField
//////////////////////////////////////////////////
//////////////////////////////////////////////////
PUBLIC FUNCTION QueryTarget4Region
RECEIVE: 1 integer represents the region
return the target coordinates for that region
endQueryTarget4Region
//////////////////////////////////////////////////
//////////////////////////////////////////////////
PUBLIC FUNCTION FindRegion
RECEIVE: no receive
switch self to get self coordinate
search all the regions to find where is self
//////////////////////////////////////////////////
//////////////////////////////////////////////////
PUBLIC FUNCTION CalcAngle
RECEIVE: two vectors
calculate the angle between two vectors
//////////////////////////////////////////////////
//////////////////////////////////////////////////
PRIVATE FUNCTION isBlow
RECEIVE: 3 integers, 1 represents the Line number
the other 2 represents the coordinates of
the point
calculate to see that if the point is blow the line
endisBlow
//////////////////////////////////////////////////
//////////////////////////////////////////////////
PRIVATE FUNCTION isAbove
RECEIVE: 3 integers, 1 represents the Line number
the other 2 represents the coordinates of
the point
calculate to see that if the point is above the line
endisAbove
//////////////////////////////////////////////////

//////////////////////////////////////////////////
PRIVATE FUNCTION isLeft
RECEIVE: 3 integers, 1 represents the Line number
the other 2 represents the coordinates of
the point
calculate to see that if the point is at the left side
of the line
endisLeft
//////////////////////////////////////////////////
//////////////////////////////////////////////////
PRIVATE FUNCTION isRight
RECEIVE: 3 integers, 1 represents the Line number
the other 2 represents the coordinates of
the point
calculate to see that if the point is at the right side
of the line
endisLeft
//////////////////////////////////////////////////

You might also like