points

Terrain curve to array of points

谁说我不能喝 提交于 2019-12-10 03:45:24
问题 In my 2D game I'm using graphic tools to create nice, smooth terrain represented by black color: Simple algorithm written in java looks for black color every 15 pixels, creating following set of lines (gray): As you can see, there's some places that are mapped very bad, some are pretty good. In other case it would be not necessary to sample every 15 pixels, eg. if terrain is flat. What's the best way to covert this curve to set of points [lines], using as little points as possible? Sampling

excel vba changing bar chart color for a data point based on point value

£可爱£侵袭症+ 提交于 2019-12-09 12:36:30
问题 I have a some charts that in which the X Values are text and Y Values are numerical. I want to color each bar Red if the Y value for the bar is less than zero, Green if greater than or equal to zero. Also, if the X value of the bar is "NET CHANGE", I need the bar to be yellow. I followed the directions in a previous StackOverflow thread here: Changing Bar colors using VBA based on category label. I'm getting Run-time error 451 Property let procedure not defined and property get procedure did

Find points in cells through pandas dataframes of coordinates

只谈情不闲聊 提交于 2019-12-09 01:48:54
问题 I have to find which points are inside a grid of square cells, given the points coordinates and the coordinates of the bounds of the cells, through two pandas dataframes. I'm calling dfc the dataframe containing the code and the boundary coordinates of the cells (I simplify the problem, in the real analysis I have a big grid with geographical points and tons of points to check): Code,minx,miny,maxx,maxy 01,0.0,0.0,2.0,2.0 02,2.0,2.0,3.0,3.0 and dfp the dataframe containing an Id and the

Centre of a circle that intersects two points

﹥>﹥吖頭↗ 提交于 2019-12-07 10:34:47
问题 Given two points in a 2D plane, and a circle of radius r that intersects both of those points, what would be the formula to calculate the centre of that circle? I realise there would two places the circle can be positioned. I would want the circle whose centre is encountered first in a clockwise direction when sweeping the line that joins the two points around one of those points, starting from an arbitrary angle. I guess that is the next stage in my problem, after I find an answer for the

3D contour of a list of points (concave hull)

时光总嘲笑我的痴心妄想 提交于 2019-12-06 08:14:01
问题 I have a list of Vector3 points in c#, and I need to calculate the concave contour of these. There's really a lot of references around, especially for -convex- resolution (which I have successfully implemented already, thanks to graham's algorithm), however, since my need is now to effectively compute a concave contour, I'm lost: wikipedia does list a lot of resources for convex calculation, but none for -concave-. Anybody with math knowledge that can give me a lead on the available concave

How to Access Points location on OpenCV Matcher?

帅比萌擦擦* 提交于 2019-12-06 06:08:58
问题 I am using this FLANN matcher algorithm to match interest points in 2 pictures the code is displayed below). There is a moment when the code finds a list of matched points: std::vector<DMatch> good_matches; I would like to get the points localization (x,y) in both pictures. To create a displacement map. How could I access these points localization? Cheers, #include <stdio.h> #include <iostream> #include "opencv2/core/core.hpp" #include "opencv2/nonfree/features2d.hpp" #include "opencv2

Calculate the horizon of a curved face?

被刻印的时光 ゝ 提交于 2019-12-06 03:31:00
I need to find the 2 points of the visual horizon , of a curved face. I have: XYZ of the 4 corner points XYZ of the 2 curved edge bezier points And I need to calculate either: XY of the horizon points XYZ of the horizon points First off you have to convert your 3D beziers to 2D. If I remember right it's sufficient to project the curves just like you project 3D points for rendering. Afterwards you have to find the extrema of the curves. A small HowTo: Convert your bezier-curve from bezier representation to a polyonomial of the form x(t) = a*t^3 + b*t^2 + c*t + d y(t) = e*t^3 + f*t^2 + g*t + g

Calculating a 2D joint probability distribution

和自甴很熟 提交于 2019-12-06 01:30:33
I have many points inside a square. I want to partition the square in many small rectangles and check how many points fall in each rectangle, i.e. I want to compute the joint probability distribution of the points. I am reporting a couple of common sense approaches, using loops and not very efficient: % Data N = 1e5; % number of points xy = rand(N, 2); % coordinates of points xy(randi(2*N, 100, 1)) = 0; % add some points on one side xy(randi(2*N, 100, 1)) = 1; % add some points on the other side xy(randi(N, 100, 1), :) = 0; % add some points on one corner xy(randi(N, 100, 1), :) = 1; % add

Terrain curve to array of points

喜欢而已 提交于 2019-12-05 05:28:25
In my 2D game I'm using graphic tools to create nice, smooth terrain represented by black color: Simple algorithm written in java looks for black color every 15 pixels, creating following set of lines (gray): As you can see, there's some places that are mapped very bad, some are pretty good. In other case it would be not necessary to sample every 15 pixels, eg. if terrain is flat. What's the best way to covert this curve to set of points [lines], using as little points as possible? Sampling every 15 pixels = 55 FPS, 10 pixels = 40 FPS Following algorithm is doing that job, sampling from right

Three.js shape from random points

纵饮孤独 提交于 2019-12-04 19:30:21
I have a N number of random points (in this case 20), with a X,Y and Z constrains. How can I create ANY (preferably closed) shape (using Three.js library) , given and starting only from N random points. There are probably many variants, please share yours. var program = new Program(reset,step) program.add('g',false) function reset() { scene.clear() scene.add(new THREE.GridHelper(100,1)) } function step() { } program.startup() var numpoints = 20; var dots = []; //If you want to use for other task for (var i = 0 ; i < numpoints ; i++){ var x = Math.random() * (80 - 1) + 1 //Math.random() * (max