Questions tagged [point]

A point is a fundamental geometry entity.

Points are the basis for any other geometry entities, like lines, boxes, polygons, etc.

Find more information on points here.

2011 questions
135
votes
12 answers

Convert Pixels to Points

I have a need to convert Pixels to Points in C#. I've seen some complicated explanations about the topic, but can't seem to locate a simple formula. Let's assume a standard 96dpi, how do I calulate this conversion?
Todd Davis
  • 5,855
  • 10
  • 53
  • 89
108
votes
3 answers

Control point border thickness in ggplot

When using ggplot, I can set shape to 21-25 to get shapes that have independent setting for the internal (fill) and border (col) colors, like so: df <- data.frame(id=runif(12), x=1:12, y=runif(12)) ggplot(df, aes(x=x, y=y)) + …
Noam Ross
  • 5,969
  • 5
  • 24
  • 40
85
votes
10 answers

Mouse / Canvas X, Y to Three.js World X, Y, Z

I've searched around for an example that matches my use case but cannot find one. I'm trying to convert screen mouse co-ordinates into 3D world co-ordinates taking into account the camera. Solutions I've found all do ray intersection to achieve…
Rob Evans
  • 6,750
  • 4
  • 39
  • 56
63
votes
5 answers

Quadratic Bézier Curve: Calculate Points

I'd like to calculate a point on a quadratic curve. To use it with the canvas element of HTML5. When I use the quadraticCurveTo() function in JavaScript, I have a source point, a target point and a control point. How can I calculate a point on the…
Christian Engel
  • 3,738
  • 5
  • 28
  • 44
63
votes
15 answers

What is the fastest way to find the "visual" center of an irregularly shaped polygon?

I need to find a point that is a visual center of an irregularly shaped polygon. By visual center, I mean a point that appears to be in the center of a large area of the polygon visually. The application is to put a label inside the polygon. Here is…
Mikhil
56
votes
9 answers

Java: Calculating the angle between two points in degrees

I need to calculate the angle in degrees between two points for my own Point class, Point a shall be the center point. Method: public float getAngle(Point target) { return (float) Math.toDegrees(Math.atan2(target.x - x, target.y - y)); } Test…
Aich
  • 962
  • 2
  • 9
  • 19
56
votes
0 answers

Determine which side of a line a point lies

I've got a line through points (x1,y1) and (x2, y2). I'd like to see if point (x3, y3) lies to the "left" or "right" of said line. How would I do so?
Skizit
  • 43,506
  • 91
  • 209
  • 269
56
votes
4 answers

How can I label points in this scatterplot?

Can you help me on putting labels on the following graph? The code i use is: valbanks<-scan("banks.txt", what=list(0,0,""), sep="", skip=1,…
Mika Ike
  • 717
  • 1
  • 6
  • 9
46
votes
9 answers

Distance between point and a line (from two points)

I'm using Python+Numpy (can maybe also use Scipy) and have three 2D points (P1, P2, P3); I am trying to get the distance from P3 perpendicular to a line drawn between P1 and P2. Let P1=(x1,y1), P2=(x2,y2) and P3=(x3,y3) In vector notation this…
user1185675
  • 495
  • 1
  • 4
  • 4
42
votes
4 answers

Checking if a point is inside a polygon

I have a class describing a Point (has 2 coordinates x and y) and a class describing a Polygon which has a list of Points which correspond to corners (self.corners) I need to check if a Point is in a Polygon Here is the function that is supposed to…
Helena
  • 921
  • 1
  • 15
  • 24
36
votes
9 answers

Hexagonal Grids, how do you find which hexagon a point is in?

I have a map made up of rows and columns of hexagons This isn't an actual image of the hex-map I am using, but uses the same size and shape hexagons I need to be able to tell which one the mouse is over when the user clicks, Each Hexagon is…
Troyseph
  • 4,960
  • 3
  • 38
  • 61
32
votes
12 answers

Find if point lies on line segment

I have line segment defined by these two points: A(x1,y1,z1) and B(x2,y2,z2). I have point p(x,y,z). How can I check if the point lies on the line segment?
AMH
  • 6,363
  • 27
  • 84
  • 135
30
votes
3 answers

mongodb check if point is in polygon

mongo 2.6 I have some amount of stored polygons. And I have a point. I what to know if this point fits any of stored polygons document example { ..., "polygons" : [ [ 17.60083012593064, 78.18557739257812 ], [ 17.16834652544664, 78.19381713867188 ],…
user3806072
  • 303
  • 1
  • 3
  • 4
26
votes
4 answers

Algorithm for generating a triangular mesh from a cloud of points

In some simulation program we generate object surfaces in terms of points, each point has 3D coordinates and the vector that represents the normal to the surface at that point. For visualization purposes we would like to generate a mesh composed of…
Open the way
  • 26,225
  • 51
  • 142
  • 196
26
votes
3 answers

Algorithm for determining whether a point is inside a 3D mesh

What is a fast algorithm for determining whether or not a point is inside a 3D mesh? For simplicity you can assume the mesh is all triangles and has no holes. What I know so far is that one popular way of determining whether or not a ray has…
Jeff Jenkins
  • 481
  • 1
  • 4
  • 7
1
2 3
99 100