polygon

Issue with calculating 3d polygon's face normal using Newell's algorithm

放肆的年华 提交于 2019-12-12 01:04:58
问题 I'm trying to calculate 3D polygon's normal using Newell's approach. The problem I'm facing is that the value of z is always returned in positive even though the polygon is facing -z. However, when it's facing -z it also flips the values of x and y as well so if actual value of x is -x it'll be +x and same goes for the y. I can't figure out why that is happening. I hope someone can point out what I'm doing wrong. Here's what I wrote so far (using PHP): $verticies = [ [57.36, 30.98, 0.0], [52

How to assign the mainController and a custom view to an app with a single window?

隐身守侯 提交于 2019-12-11 17:59:37
问题 I am another rookie in iPhone programming and I have a very basic question which I can not answer. First of all, I am writing code in xcode 3.1.4, so that I can learn the basics on an old platform and hopefully in the near future this will allow me to create portable apps (in the sense that I will be supporting iPhone 3 as well). Unfortunately though, from what I understand, apple has stripped the documentation that came with xcode 3.1.4 and this makes it hard to guess what is the right way

Find closest subdistrict to point on map

血红的双手。 提交于 2019-12-11 16:27:39
问题 I have table metro_station: CREATE TABLE metro_station ( metro_station_id int(11) NOT NULL DEFAULT '0', metro_station_name varchar(25) NOT NULL DEFAULT '', lng double(12,8) NOT NULL DEFAULT '0.00000000', lat double(12,8) NOT NULL DEFAULT '0.00000000', PRIMARY KEY (metro_station_id), KEY metro_line_id (metro_line_id) ) INSERT INTO metro_station (metro_station_id, metro_station_name, lng, lat) VALUES (101, 'Name1', 27.53907013, 53.88590000), (102, 'Name2', 27.54864857, 53.89176877); AND Table

Plot polygon using D3

假如想象 提交于 2019-12-11 15:19:56
问题 I am trying to plot a polygon using a .json file. *EDIT to add sample coordinates { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [ [ [ -0.0691250297447329, 51.5462448874379 ], [ -0.0691510961928943, 51.5459630404703 ], [ -0.0692056531364391, 51.5456827414947 ], [ -0.0692883661627076, 51.5454050640766 ], [ -0.0693070134960316, 51.545356361588 ],..... The script looks like var width = 960; var height = 600; var svg = d3.select(

MySQL 5.7.19 Invalid GIS data provided to function st_geometryfromtext

☆樱花仙子☆ 提交于 2019-12-11 15:14:34
问题 So I am new at ST_ functions in MySql and I think that I am missing something. I am trying to save a POLYGON in MySql, the problem is that when using the function ST_GEOMFROMTEXT and giving the coordinates of the POLYGON taken from Google Maps Javascript API it returns the error: Invalid GIS data provided to function st_geometryfromtext . I've read a lot in Internet but everywhere it mostly says that it's a version problem, the thing here is the I have the most recent one right now (5.7.19)

Make polygons perpendicular to bearing in google maps android

三世轮回 提交于 2019-12-11 14:57:03
问题 I'm creating polygons on a map getMap().addPolygon( getPolygonOptions(point1, point2, widthInMeters) .fillColor(Color.YELLOW)); The position of the corners is calculated by: public static PolygonOptions getPolygonOptions(LatLng point1, LatLng point2, double widthInMeters) { double distance = SphericalUtil.computeDistanceBetween(point1, point2) + 6; float bearing = location.getBearing(); double bears = bearing; LatLng corner1 = SphericalUtil.computeOffset(point2, widthInMeters / 2, bears + 90)

Algorithm to create polygons of enclosed areas

梦想的初衷 提交于 2019-12-11 13:52:43
问题 I have multiple circles (as list of connected vertices) at random positions. When the circles intersect, closed areas are created (just like in a venn diagram http://en.wikipedia.org/wiki/Venn_diagram) How do I generate separate polygons of all of these areas? The goal would be to be able to color every region with a separate polygon like in this example: Is a general solution possible with iterative boolean intersection operations? EDIT The following simple snipped is a [NodeBox](http:/

OpenGL GL_POLYGON Not Functioning Properly

假如想象 提交于 2019-12-11 13:38:11
问题 I have an OpenGL-related issue. Whenever I attempt to draw a simple polygon using four vertices from a vertex buffer... nothing happens. However, it will draw the shape in GL_TRIANGLES or GL_TRIANGLE_STRIP mode, albeit distorted. Am I doing something wrong? Relevent code: Vertex array: http://i.imgur.com/nEcbw.png GL_POLYGON: http://i.imgur.com/idfFT.png GL_TRIANGLES: http://imgur.com/84ey3,idfFT,nEcbw#0 GL_TRIANGLE_STRIP: http://i.imgur.com/JU3Zl.png 回答1: I'm using a forward-compatible 3.2

Detect correct number of CORNER coordinates from a Polygon image in MATLAB

社会主义新天地 提交于 2019-12-11 12:50:17
问题 I have a number of polygon images like a hexagon, a pentagon, any quadrilateral etc.. i need to generalize the detection technique to detect the RIGHT number of Corner coordinates.. no extra coordinates should be generated. for eg:- the code should detect only 4 for a quadrilateral, 3 for triangle, 5 for pentagon and so on.. I used HARRIS corner detection to detect right corners by specifying the number of corners value but i cant use the same code for an image with different number of edges.

Add some area in polygon [JavaScript:: Google Map API v3]

落花浮王杯 提交于 2019-12-11 11:51:34
问题 I have some points in database that make polygon on map. i am using Google Map Api v 3 . Now I am trying to add some area in polygon such as I would like to add 100m in every side of polygon and make new one on map along with the original. I tried that but it not make correctly. i add up my code here. Note 100m area is just example value Code $(function() { mapOptions = new Object(); mapOptions.zoom=19; mapOptions.center = new google.maps.LatLng(33.575802425924934, 73.14534723758698);