point

distance from point within a polygon to polygon edge

若如初见. 提交于 2019-12-01 21:39:54
I am working with a huge area, 7 states of forest and nonforest using the NLCD data. Within some of the forested areas is a plot (this is my master's thesis I am working on). I have stumped everyone I have asked with this large dataset but we are certain there is a resolution out there. The forest/nonforest area is a signed and discrete raster. I was able to make the forested area into polygons by subsetting out the forested area. I am not able to make the nonforest area into polygons (too large). So I was trying to get point distance (the point is within the polygon) to the edge of the

Java: Rotate Point around another by specified degree value

最后都变了- 提交于 2019-12-01 19:40:16
I am trying to rotate a 2D Point in java around another with a specified degree value, in this case simply around Point (0, 0) at 90 degrees. Method: public void rotateAround(Point center, double angle) { x = center.x + (Math.cos(Math.toRadians(angle)) * (x - center.x) - Math.sin(Math.toRadians(angle)) * (y - center.y)); y = center.y + (Math.sin(Math.toRadians(angle)) * (x - center.x) + Math.cos(Math.toRadians(angle)) * (y - center.y)); } Expected for (3, 0): X = 0, Y = -3 Returned for (3, 0): X = 1.8369701987210297E-16, Y = 1.8369701987210297E-16 Expected for (0, -10): X = -10, Y = 0 Returned

Detect square in a List of Points

徘徊边缘 提交于 2019-12-01 17:58:19
I want to test if there is a square in a list of Point object or not. This is my Point class : class Point { private int x; private int y; public Point(int x, int y) { this.x = x; this.y = y; } public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y; } public void setY(int y) { this.y = y; } public int distanceSquare(Point q) { return (x - q.getX()) * (x - q.getX()) + (y - q.getY()) * (y - q.getY()); } } I can test if four Point is a Square or not : static boolean isSquare(Point p1, Point p2, Point p3, Point p4) { int d2 = p1.distanceSquare(p2); //

Detect square in a List of Points

╄→尐↘猪︶ㄣ 提交于 2019-12-01 17:49:37
问题 I want to test if there is a square in a list of Point object or not. This is my Point class : class Point { private int x; private int y; public Point(int x, int y) { this.x = x; this.y = y; } public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y; } public void setY(int y) { this.y = y; } public int distanceSquare(Point q) { return (x - q.getX()) * (x - q.getX()) + (y - q.getY()) * (y - q.getY()); } } I can test if four Point is a Square or not

Two ways to get value of Point object?

六眼飞鱼酱① 提交于 2019-12-01 17:34:06
问题 How come you can get the x and y values from a java.awt.Point class by using a method and referencing the value? Point p = new Point(10,20); int x0 = p.getX(); int y0 = p.getY(); int x1 = p.x; int y1 = p.y; System.out.println(x0+"=="+x1+"and"+y0+"=="+y1); Did the people who made this class forget to make x and y private? 回答1: Looking at the javadoc, these seem to return different types. p.x returns an int while p.getX() returns a double . The source code of Point shows this: public int x; //.

Calculate curvature for 3 Points (x,y)

≡放荡痞女 提交于 2019-12-01 13:15:31
I have a two dimensional euclidean space. Three points are given. For example (p2 is the middle point): Point2D p1 = new Point2D.Double(177, 289); Point2D p2 = new Point2D.Double(178, 290); Point2D p3 = new Point2D.Double(178, 291); Now i want to calculate the curvature for these three points. double curvature = calculateCurvature(p1, p2, p3); How to do this? Ist there a existing method (no java external libraries)? Curvature: https://en.wikipedia.org/wiki/Curvature Menger Curvature: https://en.wikipedia.org/wiki/Menger_curvature For the Menger Curvature, the formula is right there in the

Display numbers instead of points using pyplot [duplicate]

。_饼干妹妹 提交于 2019-12-01 12:39:27
问题 This question already has answers here : Matplotlib scatter plot with different text at each data point (4 answers) Closed 2 years ago . I have a nx2 dimension array representing n points with their two coordinates x, y. Using pyplot, I would like to display the number n of my points instead of just the points with no way to know which is what. I have found a way to legend my points but really what I would like is only the number. How can I achieve this ? 回答1: You may use plt.text to place

How to add 2 org.opencv.core.Point objects in Android?

我的未来我决定 提交于 2019-12-01 10:58:49
I'm new to OpenCV and Android. I'm tring to covert a C++ code to java line( img_matches, scene_corners[0] + Point2f( img_object.cols, 0), scene_corners[1] + Point2f( img_object.cols, 0), Scalar(0, 255, 0), 4 ); this is the last part of it. Here, I replaced line with Core.line() But now problem is adding these 2 points in the above code. scene_corners[0] + Point2f( img_object.cols, 0) I replaced ( scene_corners[0],Point2f( img_object.cols, 0) ) with scene_corners.get(0),new Point(img_object.cols(),0) Since both are org.opencv.core.Point type objects, these types of operations are not supported.

plot a 3d point in MatLab

岁酱吖の 提交于 2019-12-01 08:13:04
I'm trying to plot just one point in any coordinate system: Cartesian, cylindrical or spherical. I tried plot3(1,1,1) with many values but just shows a tiny point in the same location for all values! I tried surf(X,Y,Z) as well but matlab said: Z must be a matrix, not a scalar or vector. bla How about this? plot3(1,1,1,'.'); grid on You did try it, but then again, that is exactly what it does! Something like scatter3(x,y,z1,720,'g','fill') will make opaque green spheres of 720 size around all the points listed in the vectors x,y,z1. 来源: https://stackoverflow.com/questions/13748633/plot-a-3d

How to add 2 org.opencv.core.Point objects in Android?

旧巷老猫 提交于 2019-12-01 07:28:10
问题 I'm new to OpenCV and Android. I'm tring to covert a C++ code to java line( img_matches, scene_corners[0] + Point2f( img_object.cols, 0), scene_corners[1] + Point2f( img_object.cols, 0), Scalar(0, 255, 0), 4 ); this is the last part of it. Here, I replaced line with Core.line() But now problem is adding these 2 points in the above code. scene_corners[0] + Point2f( img_object.cols, 0) I replaced ( scene_corners[0],Point2f( img_object.cols, 0) ) with scene_corners.get(0),new Point(img_object