我想在C做些什麼,我正在建立一個服務器,將會收到一個經緯度座標-23.0001,-43.3417是確切的,我正在嘗試做一個10km圍繞該座標的半徑圓,有可能嗎?我放棄了試圖使一個圓圈,並試圖讓一個正方形20公里邊,在這裏我給的是中心的座標,但我一直沒有,這裏是我想要幫助Circle in C
Quad *cria_quadrado_complex(Coords *b)
{
Quad* a = (Quad*) malloc(sizeof(Quad));
a->x1 = b->x + 0.0433;
a->x2 = b->x + 0.0587;
a->y1 = b->y + 0.0433;
a->y2 = b->y + 0.0490;
return a;
}
使用的結構分別是:
struct coordenadas
{
double x,
y;
};
struct quadrado
{
double x1,
x2,
y1,
y2;
};
typedef struct coordenadas Coords;
typedef struct quadrado Quad;
這些東西0.0的值是我從谷歌地圖的測量值,但他們是從中央和dindn't工作faar,有沒有更好的方式來做到這一點?幫助
PS -23.0001,-43.3417是座標從谷歌地圖
這裏是我想要做的一個例子:
1---------- 1 : top coordinate of the square
-----------
-----C----- C : center coordinate (-23.0001, -43.3417)
-----------
----------2 2 : bottom coordinate of the square
1和2我要與自動生成中心座標,他們將遠離中心,所以廣場的兩邊是10公里
你的用例是什麼? – Trott 2011-05-24 00:49:04