point

Point of impact: circle collision

▼魔方 西西 提交于 2019-12-24 11:37:49
问题 I'm doing a school project about robocup where robots are playing football with AI. As everything works fine I am still stuck with something. The robots are simple spheres drawn from top view. Both player shouldn't be allowed to walk into each other and should get a new updated position on the point of impact. As the collision handler just checks if they collide or not.. I was hoping if there was a way to detect where the circles collide. So I can update the position of the colliding sphere

How to use a Point or Geometry type in Datamapper (codeigniter)

纵然是瞬间 提交于 2019-12-24 10:27:34
问题 I'm using codeigniter and datamapper to build an API service (on mysql), and part of it involves geolocation - however I can't seem to find a workaround to use the point datatype. If I try to insert GeomFromText, the system treats it as a string. Can anyone help? Cheers, Mark. 回答1: Try CREATE TABLE Points ( ID INT(10) PRIMARY KEY NOT NULL AUTO_INCREMENT, location POINT NOT NULL, SPATIAL INDEX(location) ) ENGINE= MYISAM In CodeIgniter: $this->db->set("location",'geomfromtext("POINT(30.2 40.3)"

Adding random weighted point

☆樱花仙子☆ 提交于 2019-12-24 07:46:30
问题 Let's say I have a blank canvas with 2 red points in it. Is there an algorithm to randomly add a point in the canvas but in a way where it's more bias to the red points with a supplied radius? Here's a crude image as an example: Even though this question is for Python it really applies for any language. 回答1: Sure. Select first point or second point randomly, then generate some distribution with single scale parameter in polar coordinates, then shift by center point position. Select some

Sort an array of points to generate an envelope in MATLAB

狂风中的少年 提交于 2019-12-24 06:58:12
问题 I have the next vectors: A = [0;100;100;2100;100;2000;2100;2100;0;100;2000;2100;0]; B = [0;0;1450;1450;1550;1550;1550;1550;2500;2500;3000;3000;0] If we plot A and B, we'll obtain the following graphic: Then, I wonder how to short the points in order to have the next plot: As you can see, there're some conditions like: all of them form right angles; there's no intersection between lines. Thanks in advance for any reply! 回答1: This can be solved in the traditional recursive 'maze' solution of

Android XYPlot set width of line, size of point and disable legend

不羁岁月 提交于 2019-12-24 06:38:40
问题 I'm trying to change width of line in XYPlot and size of point, any suggestion? And another question - how i disable legend to SimpleXYSeries? Set to null cause Error. 回答1: I'm trying to change width of line in XYPlot and size of point. Any suggestion? As shown here, you can alter the line thickness using either setSeriesStroke() or setBaseStroke() in your chosen renderer. Assuming XYLineAndShapeRenderer , you can change the rendered Shape using the approach shown here. How I disable the

.points opacity / size within three.js

…衆ロ難τιáo~ 提交于 2019-12-24 06:21:56
问题 I'm back for question two on .points. This time wondering how to change the opacity from 0, to 1 and then back within certain pixel distances from the emitter. var particleCount = 14, particles = new THREE.Geometry(), pMaterial = new THREE.PointsMaterial({ map: new THREE.TextureLoader().load("x.png"), blending: THREE.multiplyBlending, flatShading: true, size: 40, transparent: true, depthTest: true, sizeAttenuation: true, opacity: 1 }); var particleSystem; My main confusion is that even though

Convert a 3D location to a 2D on-screen point. (XYZ => XY)

家住魔仙堡 提交于 2019-12-24 02:08:08
问题 I am wondering how exactly I can convert a location (X Y Z) to a point on screen (X Y). I have a player (the player you control) who is in (X Y Z) co-ordinates and another player who is also in (X Y Z) co-ordinates. How exactly can I convert the other player's X Y Z to X Y on screen so that I can draw a name above him/it using the X Y. Hope that makes sense... Edit: Here is my gluProject code: IntBuffer viewport = GLAllocation.createDirectIntBuffer(16); FloatBuffer modelview = GLAllocation

How to get a fixed number of evenly spaced points describing a path?

拥有回忆 提交于 2019-12-23 16:53:45
问题 Given is a path described by an ordered array of points (x,y). I'm looking for an algorithm that describes this path with a given number of points (k) that are evenly spaced along the path. Input points : [[x1,y1], ..., [xn,yn]] (randomly spaced) Where x1,y1 is the first waypoint and xn,yn the last. The path is defined by connecting every point to the next with a straight line. (Xn,Yn) -----> (Xn+1,Yn+1) Expected output : [[x1,y1], ..., [xk,yk]] (evenly spaced) Image of an example path Update

Determine whether a point lies in a convex hull in O(log n) time [duplicate]

喜你入骨 提交于 2019-12-23 07:05:22
问题 This question already has answers here : Test point for its position relative to the convex hull in log(n) (6 answers) Closed 4 years ago . I've researched several algorithms for determining whether a point lies in a convex hull, but I can't seem to find any algorithm which can do the trick in O(logn) time, nor can I come up with one myself.Let a[] be an array containing the vertices of the convex hull, can I pre-process this array in anyway, to make it possible to check if a new point lies

Check if an array of points is inside an array of rectangles?

六眼飞鱼酱① 提交于 2019-12-23 04:53:07
问题 I have a list of vertices and a list of regions (which are square/rectangle) shaped. Vertex has x and y coordinates, and a region has (x, y, height and width). How can I efficiently check which vertex lies in which region for every vertex/region? EDIT: This is the code I wrote to do this. if (!g.getVertices().isEmpty()) { for (int i = 0; i < g.getVertices().size(); i++) { Vertex v = g.getVertices().get(i); Point vertexPoint = new Point(v.getX(), v.getY()); for (int j = 0; j < g