coordinate-transformation

Mac OS X: Convert between NSView coordinates and global screen coordinates

此生再无相见时 提交于 2020-01-12 12:05:34
问题 I have the following situation in my multi-monitor setup: In this example I want to position a window exactly at the coordinates depicted with the yellow arrow. All I do have however, are the coordinates of an NSView that is a subview of the contentView of an NSWindow that spans the entire (bigger,upper) secondary monitor. Here's how the global coordinate space is defined: {0,0} is the coordinate of the upper left corner of my laptop screen. (green) {-296, -1080} is the coordinate of the

Mac OS X: Convert between NSView coordinates and global screen coordinates

三世轮回 提交于 2020-01-12 12:01:49
问题 I have the following situation in my multi-monitor setup: In this example I want to position a window exactly at the coordinates depicted with the yellow arrow. All I do have however, are the coordinates of an NSView that is a subview of the contentView of an NSWindow that spans the entire (bigger,upper) secondary monitor. Here's how the global coordinate space is defined: {0,0} is the coordinate of the upper left corner of my laptop screen. (green) {-296, -1080} is the coordinate of the

Python/Matplotlib : convert Axis <=> Data coordinates systems

扶醉桌前 提交于 2020-01-10 14:16:11
问题 My question is quite simple : in matplotlib, how can I easily convert coordinates in Axis system to/from Data system (Ideally I'm looking for a simple function output_coords = magic_func(input_coords) ) Actually my exact problem is : I'd like to plot an matplotlib.patches.Ellipse with his center in Axis system but his size (width & length) in Data system. But the transforms.blended_transform_factory method doesn't work in this case. Thanks ! 回答1: To get transformations from the Axes instance

Python/Matplotlib : convert Axis <=> Data coordinates systems

橙三吉。 提交于 2020-01-10 14:15:16
问题 My question is quite simple : in matplotlib, how can I easily convert coordinates in Axis system to/from Data system (Ideally I'm looking for a simple function output_coords = magic_func(input_coords) ) Actually my exact problem is : I'd like to plot an matplotlib.patches.Ellipse with his center in Axis system but his size (width & length) in Data system. But the transforms.blended_transform_factory method doesn't work in this case. Thanks ! 回答1: To get transformations from the Axes instance

Openlayers 3 GeoJSON coordinates shows wrong result

让人想犯罪 __ 提交于 2020-01-05 09:49:00
问题 I am using angular-openlayers-directive to build my project. I try to rewrite the example of geojson part cause I will get point information dynamically. So I made the source part of geojson inside instead of loading from json file. However, the position of my code is totally different as I expect. The result suppose to show a point at that coordinate I set. But the point is like at the [0, 0]. If I change the to use loading from the json file, that will work. I have no idea why the

Openlayers 3 GeoJSON coordinates shows wrong result

邮差的信 提交于 2020-01-05 09:47:28
问题 I am using angular-openlayers-directive to build my project. I try to rewrite the example of geojson part cause I will get point information dynamically. So I made the source part of geojson inside instead of loading from json file. However, the position of my code is totally different as I expect. The result suppose to show a point at that coordinate I set. But the point is like at the [0, 0]. If I change the to use loading from the json file, that will work. I have no idea why the

Madgwick's sensor fusion algorithm on iOS

不打扰是莪最后的温柔 提交于 2020-01-02 18:03:14
问题 i'm trying to run Madgwick's sensor fusion algorithm on iOS. Since the code is open source i already included it in my project and call the methods with the provided sensor values. But it seems, that the algorithm expects the sensor measurements in a different coordinate system. The Apple CoreMotion Sensor System is given on the right side, Madgewick's on the left. Here is the picture of the different coordinate systems. Both systems follow the right hand rule. For me it seems like there is a

Transforming coordinates of one rectangle to another rectangle

荒凉一梦 提交于 2020-01-02 04:06:11
问题 in the above image I have shown two rectangles rectangle 1 whose x can vary from -900 to 13700 and Y can vary from -600 to 6458 rectangle 2 whose coordinate X can vary from 0 to 3000 and y can vary from 0 to 2000 Also: rectangle 2 has its starting point at left top position(0,0) whereas rectangle 1 has starting point( width/2, height/2). What I need to do : to convert a point of rectangle 1 to point of rectangle 2 using scaling or translation. So, what should be scaling factor for x and y

How do I compute the linear index of a 3D coordinate and vice versa?

北城余情 提交于 2019-12-31 22:26:29
问题 If I have a point (x, y z), how do I find the linear index, i for that point? My numbering scheme would be (0,0,0) is 0, (1, 0, 0) is 1, . . ., (0, 1, 0) is the max-x-dimension, .... Also, if I have a linear coordinate, i, how do I find (x, y, z)? I can't seem to find this on google, all the results are filled with other irrelevant stuff. Thank you! 回答1: There are a few ways to map a 3d coordinate to a single number. Here's one way. some function f(x,y,z) gives the linear index of coordinate

Convertion of mouse pointer coordinates into data coordinates and graphical object coordinates

我们两清 提交于 2019-12-31 05:36:10
问题 I googled all the day and, with my surprise, I have found only old (many years ago) answers about the topic. I tryed to mix individual pieces of code of the above mentioned answers to get a more complete solution to my needs, but nothing seems to work in the right way. The proposed solutions, even if logically understandable, don't work as expected. This should be the conceptual framework for coordinates implemented by Excel 1------------------------------------------+ |ChartObject | | 2-----