coordinates

Matrix / coordinate transformation order

一笑奈何 提交于 2019-12-29 09:08:11
问题 I have two array of points: Point [] original; AND Point [] transformed; These transformed array is simply a copy of the original with transformations applied. Example: matrix.Rotate(5f); matrix.Scale(.8f, 1.1f); matrix.Translate(30f, 18f); matrix.TransformPoints(transformed); The original points ARE known. The transformation values ARE known. The order in which the transformations were applied is NOT known. How can I calculate / infer the order of transformations? EDIT There is only ONE

How to determine if a point is within a quadrilateral

房东的猫 提交于 2019-12-29 05:49:11
问题 Goal I want to determine if a test point is within a defined quadrilateral. I'm probably going to implement the solution in Matlab so I only need pseudo-code. Inputs Corners of quadrilateral : (x1,y1) (x2,y2) (x3,y3) (x4,y4) Test point : (xt, yt) Output 1 - If within quadrilateral 0 - Otherwise Update It was pointed out that identifying the vertices of the quadrilateral is not enough to uniquely identify it. You can assume that the order of the points determines the sides of the quadrilateral

How to convert X/Y position to Canvas Left/Top properties when using ItemsControl

半城伤御伤魂 提交于 2019-12-28 13:58:32
问题 I am trying to use a Canvas to display objects that have "world" location (rather than "screen" location). The canvas is defined like this: <Canvas Background="AliceBlue"> <ItemsControl Name="myItemsControl" ItemsSource="{Binding MyItems}"> <Image x:Name="myMapImage" Panel.ZIndex="-1" /> <ItemsControl.ItemTemplate> <DataTemplate> <Canvas> <TextBlock Canvas.Left="{Binding WorldX}" Canvas.Top="{Binding WorldY}" Text="{Binding Text}" Width="Auto" Height="Auto" Foreground="Red" /> </Canvas> <

Coordinates all wrong on iPhone 3G? It could be your compiler

有些话、适合烂在心里 提交于 2019-12-28 06:45:13
问题 Note: This is question to which I have already found an answer. It seems that posting a question after finding an interesting answer is encouraged, so I am posting this. Someone else is likely to have the same problem and find this useful. I have an iOS app that produces charts. Shortly after publishing an update, a user sent me this panicky email: "the latest update has modified the curves ... not seen more growth curves and inserted data are represented as a line descending ... before you

How can I print a string to the console at specific coordinates in C++?

萝らか妹 提交于 2019-12-28 02:58:07
问题 I'm trying to print characters in the console at specified coordinates. Up to now I have been using the very ugly printf("\033[%d;%dH%s\n", 2, 2, "str"); But I just had to ask whether C++ had any other way of doing this. The problem is not even that it's ugly, the problem comes up when I try to make myself a prettier function like so: void printToCoordinates(int x, int y, string text) { printf("\033[%d;%dH%s\n", x, x, text); } It doesn't work, even if I typecast to (char*) . Another problem

Converting latitude and longitude points to UTM

做~自己de王妃 提交于 2019-12-27 17:34:09
问题 I found a fairly simple example of how to do this but I cant get it to work for me. I'm pretty new to R library(rgdal) xy <- cbind(c(118, 119), c(10, 50)) project(xy, "+proj=utm +zone=51 ellps=WGS84") [,1] [,2] [1,] -48636.65 1109577 [2,] 213372.05 5546301 But this is with example numbers. I have thousands of coordinates I have to transform and I cant figure out how to get them from my table to into this script My data set has 3 columns, ID, X, and Y. How can I transform them using this

Converting latitude and longitude points to UTM

浪尽此生 提交于 2019-12-27 17:33:12
问题 I found a fairly simple example of how to do this but I cant get it to work for me. I'm pretty new to R library(rgdal) xy <- cbind(c(118, 119), c(10, 50)) project(xy, "+proj=utm +zone=51 ellps=WGS84") [,1] [,2] [1,] -48636.65 1109577 [2,] 213372.05 5546301 But this is with example numbers. I have thousands of coordinates I have to transform and I cant figure out how to get them from my table to into this script My data set has 3 columns, ID, X, and Y. How can I transform them using this

Cropping picture, getting Rectangle from X,Y? [closed]

大憨熊 提交于 2019-12-25 19:00:11
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I'm trying to crop a picture in C# from integer x, y coordinates.. I just can't figure out how to get it? public void doCroppedImage(int pointX, int pointY) { Rectangle cropRect = //??? } 回答1: You can use this

inheritance Classes [closed]

萝らか妹 提交于 2019-12-25 18:33:45
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . Part A I'm trying to use the function that I have inside my base class "SHAPE" with the derived class "RECTANGLE" to create a bigger rectangle in my class "BIGRECTANGLE". I want to do have my sides transformation inside the class and not in the main, What should I do? Thanks! #include <iostream> using namespace

MKPolygon to cover entire earth

若如初见. 提交于 2019-12-25 14:09:49
问题 I'm trying to create an MKPolygon that will cover the entire earth, but can't find the right coordinates. my code looks like this: CLLocationCoordinate2D pathCoords[5]={ CLLocationCoordinate2DMake(0,-90), CLLocationCoordinate2DMake(0,90), CLLocationCoordinate2DMake(-180,90), CLLocationCoordinate2DMake(180,-90), CLLocationCoordinate2DMake(0,-90), }; MKPolygon *result = [MKPolygon polygonWithCoordinates:pathCoords count:5]; I've found this article that can help: http://www-01.ibm.com/support