私はこの行列ポイント・イン・長方形の試験
/// as if the create a rectangle
int [][] loc = {
{5, 15},//(x1, y1)
{5, 30}, // (x1, y2)
{20, 15},// (x2, y1)
{20, 30}, // (x2, y2)
}
// this are the point that i want to check if they are in the rectangular range or not
int [] [] point = {
{6, 16}, //(x, y)
{3, 17}, //(x, y)
}
を持って、私はポイントを取ると、それLOCの範囲内かどうか x1<x<x2
とy1<y<y2
矩形を定義するには、2つの点(対角線上の2つの点を選択)または2つのx値と2つのy値が必要です。 –
とにかく、軸に沿った長方形... – Skilldrick
このコードはjavascriptですか? –