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.

1843 questions
128
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,493
  • 9
  • 47
  • 80
80
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
  • 4,809
  • 4
  • 20
  • 36
71
votes
9 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,066
  • 3
  • 35
  • 52
57
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,530
  • 4
  • 25
  • 43
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
  • 37,926
  • 89
  • 198
  • 265
55
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
  • 707
  • 1
  • 6
  • 9
53
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
50
votes
7 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
  • 882
  • 2
  • 8
  • 18
40
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
  • 883
  • 1
  • 14
  • 24
34
votes
8 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,393
  • 3
  • 34
  • 54
27
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
  • 5,779
  • 27
  • 75
  • 132
26
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
  • 263
  • 1
  • 3
  • 4
24
votes
2 answers

Why is the ELF execution entry point virtual address of the form 0x80xxxxx and not zero 0x0?

When executed, program will start running from virtual address 0x80482c0. This address doesn't point to our main() procedure, but to a procedure named _start which is created by the linker. My Google research so far just led me to some (vague)…
Michael L.
  • 243
  • 1
  • 2
  • 5
23
votes
8 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
  • 265
  • 1
  • 2
  • 4
22
votes
4 answers

Moving lat/lon text columns into a 'point' type column

I've got a table in my MySQL database called house. Within the house table, there are a couple of text columns called latitude and longitude. I've added a new column called coords, of type point -…
cannyboy
  • 23,724
  • 40
  • 138
  • 242
1
2 3
99 100