The online racing simulator
#26 - sun
That's DrawRectangle, which paints a rectangle onto a form. The p is the brush. You want just Rectangle, which defines a rectangular area
-
(Robbo01) DELETED by the_angry_angel
-
(Marco1) DELETED by the_angry_angel
Quote from dougie-lampkin :Oh God the irony

Agreed, that was awesome!

This is a PHP adaptation written by filur, of code (imagemap.c) originally written by Brian J. Fox ([email protected]) for MetaHTML 5.01.

<?php 
function in_poly($x$y, array $polygon) {

    
$min_x = -1;
    
$max_x = -1;
    
$min_y = -1;
    
$max_y = -1;
    
$result 0;
    
    
$vertices count($polygon);
    
    foreach (
$polygon as $point) {
        if (
$min_x == -|| $point['x'] < $min_x)
            
$min_x $point['x'];
        if (
$min_y == -|| $point['y'] < $min_y)
            
$min_y $point['y'];
        if (
$point['x'] > $max_x)
            
$max_x $point['x'];
        if (
$point['y'] > $max_y)
            
$max_y $point['y'];
    }
    
    if (
$x $xmin_x || $x $max_x || $y $min_y || $y $max_y)
        return 
FALSE;
    
    
$lines_crossed 0;
    
    for (
$i 1$polygon[$i] != null$i++) {
        
$p1 =& $polygon[$i 1];
        
$p2 =& $polygon[$i];
        
        
$min_x min ($p1['x'], $p2['x']);
        
$max_x max ($p1['x'], $p2['x']);
        
$min_y min ($p1['y'], $p2['y']);
        
$max_y max ($p1['y'], $p2['y']);
        
        if (
$x $min_x || $x $max_x || $y $min_y || $y $max_y) {
            if (
$x $min_x && $y $min_y && $y $max_y)
                
$lines_crossed++;
            
            continue;
        }
        
        
$slope = ($p1['y'] - $p2['y']) / ($p1['x'] - $p2['x']);
        if (((
$y - ($p1['y'] - ($slope $p1['x']))) / $slope) >= $x)
            
$lines_crossed++;
    }
    
    if (
$lines_crossed 2)
        return 
TRUE;
    else
        return 
FALSE;
}
?>

for memory

Point in polygon
// Globals which should be set before calling this function:
//
// int polySides = how many corners the polygon has
// float polyX[] = horizontal coordinates of corners
// float polyY[] = vertical coordinates of corners
// float x, y = point to be tested
//
// (Globals are used in this example for purposes of speed. Change as
// desired.)
//
// The function will return YES if the point x,y is inside the polygon, or
// NO if it is not. If the point is exactly on the edge of the polygon,
// then the function may return YES or NO.
//
// Note that division by zero is avoided because the division is protected
// by the "if" clause which surrounds it.

bool pointInPolygon() {

int i, j=polySides-1 ;
boolean oddNodes=NO ;

for (i=0; i<polySides; i++) {
if (polyY[i]<y && polyY[j]>=y
|| polyY[j]<y && polyY[i]>=y) {
if (polyX[i]+(y-polyY[i])/(polyY[j]-polyY[i])*(polyX[j]-polyX[i])<x) {
oddNodes=!oddNodes; }}
j=i; }

return oddNodes; }

2

FGED GREDG RDFGDR GSFDG