php - How to check if a point is inside specified area? -
php - How to check if a point is inside specified area? -
my server receive 4 points on map(a,b,c,d),that represent rectangle on map. in database have business table:
bussid | longitude | latitude ============================= .. .. ..
how businesses placed within rectangle ?
let point p. p within rectangle vertices (a,b,c,d) [in order] if , if dot product of vectors ab.ap , bc.bp, cd.cp, , da.dp having same sign (i.e. either they're positive or negative). approximate if you're talking longitude , latitude because surface of earth curved surface, not flat rectangle.
php mysql algorithm map
Comments
Post a Comment