coordinate-systems

Creating stereoParameters class in Matlab: what coordinate system should be used for relative camera rotation parameter?

北战南征 提交于 2019-12-04 06:04:37
stereoParameters takes two extrinsic parameters: RotationOfCamera2 and TranslationOfCamera2 . The problem is that the documentation is a not very detailed about what RotationOfCamera2 really means, it only says: Rotation of camera 2 relative to camera 1, specified as a 3-by-3 matrix. What is the coordinate system in this case ? A rotation matrix can be specified in any coordinate system. What does it exactly mean "the coordinate system of Camera 1" ? What are its x,y,z axes ? In other words, if I calculate the Essential Matrix, how can I get the corresponding RotationOfCamera2 and

Difference between layerX and offsetX in JavaScript

柔情痞子 提交于 2019-12-04 00:40:55
There are different co-ordinate system for JavaScript, such as e.clientX, e.screenX. I understand those two well, but there are some like e.layerX and e.offsetX. These two are not very clear to me. Can someone explain those two co-ordinates for me? offsetX / offsetY are a neat extension by Microsoft to mouse event objects, and mean the position of the mouse pointer relatively to the target element. Sadly, they're not implemented by Firefox, and there's discordance among the other browsers about what should be the origin point: IE thinks it's the content box, while Chrome, Opera and Safari the

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

半世苍凉 提交于 2019-12-03 22:55:50
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 upper left corner of my second screen (black) {0, 800} is the coordinate of the lower left corner (no arrow

How do I convert a geodetic location to an ECF position that works with the terrain model in Cesium

家住魔仙堡 提交于 2019-12-03 17:12:54
I'm trying to put a point at the top of Mount Everest in Cesium . My most likely candidate as of last night was the code I borrowed to do geodetic to ecef conversion (from PySatel.coord). Upon review this morning, it appears to be correct: a = 6378.137 b = 6356.7523142 esq = 6.69437999014 * 0.001 e1sq = 6.73949674228 * 0.001 f = 1 / 298.257223563 def geodetic2ecef(lat, lon, alt): """Convert geodetic coordinates to ECEF. Units are degrees and kilometers. """ lat, lon = radians(lat), radians(lon) xi = sqrt(1 - esq * sin(lat)) x = (a / xi + alt) * cos(lat) * cos(lon) y = (a / xi + alt) * cos(lat)

Determining a homogeneous affine transformation matrix from six points in 3D using Python

旧城冷巷雨未停 提交于 2019-12-03 08:18:18
I am given the locations of three points: p1 = [1.0, 1.0, 1.0] p2 = [1.0, 2.0, 1.0] p3 = [1.0, 1.0, 2.0] and their transformed counterparts: p1_prime = [2.414213562373094, 5.732050807568877, 0.7320508075688767] p2_prime = [2.7677669529663684, 6.665063509461097, 0.6650635094610956] p3_prime = [2.7677669529663675, 5.665063509461096, 1.6650635094610962] The affine transformation matrix is of the form trans_mat = np.array([[…, …, …, …], […, …, …, …], […, …, …, …], […, …, …, …]]) such that with import numpy as np def transform_pt(point, trans_mat): a = np.array([point[0], point[1], point[2], 1]) ap

How to convert spherical coordinates to equirectangular projection coordinates?

坚强是说给别人听的谎言 提交于 2019-12-03 05:15:28
问题 Simplified question How do you convert a spherical coordinate (θ, φ) into a position (x, y) on an equirectangular projection (also called 'geographic projection')? In which: x is longitude, the horizontal position, from -180 to 180 degrees. y is latitude, the vertical position, from -90 to 90 degrees. θ is theta, the horizontal angle in degrees, a vector from (0,0,0) to a point on the surface of a sphere. φ is phi, the vertical angle in degrees, a vector from (0,0,0) to a point on the surface

Check if geo-point is inside or outside of polygon

穿精又带淫゛_ 提交于 2019-12-03 03:47:23
问题 I am using python and I have defined the latitudes and longitudes (in degrees) of a polygon on the map. My goal is to check if a generic point P of coordinates x,y falls within such polygon. I would like therefore to have a function that allows me to check such condition and return True or False if the point is inside or outside the polygon. In this example the point is outside so the result would be False Question : Is there a library/package that allows to reach my goal? if yes which one do

Hexagonal Grid Coordinates To Pixel Coordinates

隐身守侯 提交于 2019-12-03 00:10:42
问题 I am working with a hexagonal grid. I have chosen to use this coordinate system because it is quite elegant. This question talks about generating the coordinates themselves, and is quite useful. My issue now is in converting these coordinates to and from actual pixel coordinates. I am looking for a simple way to find the center of a hexagon with coordinates x,y,z. Assume (0,0) in pixel coordinates is at (0,0,0) in hex coords, and that each hexagon has an edge of length s. It seems to me like

SpriteKit Coordinates differ between iPad and iPhone

牧云@^-^@ 提交于 2019-12-02 19:34:41
问题 I have a very simple SpriteKit scene that is not behaving like I would expect. It is a universal app and the code that I am using to draw a single red square in the scene is as follows: let redSquare = SKSpriteNode(color: UIColor .redColor(), size: CGSizeMake(100.0, 100.0)) redSquare.anchorPoint = CGPointMake(0.0, 0.0) redSquare.position = CGPointMake(1.0, 1.0) addChild(redSquare) This code is in the GameScene didMoveToView method of the default app that xCode creates for you when you select

Check if geo-point is inside or outside of polygon

喜欢而已 提交于 2019-12-02 19:11:56
I am using python and I have defined the latitudes and longitudes (in degrees) of a polygon on the map. My goal is to check if a generic point P of coordinates x,y falls within such polygon. I would like therefore to have a function that allows me to check such condition and return True or False if the point is inside or outside the polygon. In this example the point is outside so the result would be False Question : Is there a library/package that allows to reach my goal? if yes which one do you recommend? would you be able to give a small example on how to use it? Here is the code I have