I am creating a Rect in C# with two points. These points are actually Geographical bounds. The problem I am having is what when I create the rectangle the y axis is flipped.
For example say my data is west="5.42194487004" south="46.407494" east="17.166386" north="55.056664"
I pass that into Rect geoBounds = new Rect(new Point(west, north),new Point(east, south));
The Rectangle that is created has the following properties
Bottom 55.056664 double
Height 7.781945 double
IsEmpty false bool
Left 5.864166 double
Right 15.038887000000003 double
Top 47.274719 double
Width 9.1747210000000017 double
X 5.864166 double
Y 47.274719 double
The Y axis is flipped. I have triple checked that the data being fed into the call is correct. What is wrong? Also I know that I did not supply much code but did not feel any more was needed. Will provide more if needed.
The coordinate system has 0,0 at the top left of the screen, with Y increasing in the downward direction. You can see this at the example page for the
Rect.Bottomproperty: http://msdn.microsoft.com/en-us/library/system.windows.rect.bottom.aspxNote on that page this comment:
and this one:
This is further supported by the explicit constructor for
Rect: http://msdn.microsoft.com/en-us/library/ms587929%28v=vs.95%29.aspxNote that
xandydescribe the top left corner, where width extends that in the rightward direction and height extends downwards.