Questions tagged [line-segment]

90 questions
0
votes
0 answers

THREE.js LineSegments with multimaterial support

In my project I am creating LineSegments (LineMesh) with modified geometry (changing the vertex positions) from another mesh and with MeshBasicMaterialwith black color.Adding the LineMesh to the already existing Mesh. Everything works fine. But now…
Aasha joney
  • 508
  • 5
  • 23
0
votes
0 answers

Thick line intersections

I am trying to calculate the intersection between 'thick' line segments. That is, lines which, on screen, have quite a thick stroke. This is because they may occasionally need to intersect but in reality lie parallel with either other without their…
Matt W
  • 11,753
  • 25
  • 118
  • 215
0
votes
1 answer

Trouble with VB.NET Liang-Barsky implementation

After some research, I've decided to use the Liang-Barsky line clipping algorithm in my 2D game. Google did not deliver on any VB.NET implementations of this algorithm but plenty C/++ ones. Therefore, as I have knowledge in C++, decided to port one…
Saul
  • 992
  • 1
  • 13
  • 26
0
votes
0 answers

Coinciding lines

I have a class LineSegment with a function called bool LineSegment::intersect(LineSegment &otherLineSegment, Point &intersectionPoint, bool continuous=false). I added the continuous parameter since I was too lazy to inherit from my LineSegment class…
rbaleksandar
  • 8,713
  • 7
  • 76
  • 161
0
votes
2 answers

The method segments() in the type BruteCollinearPoints is not applicable for the arguments (Point, Point)

I'm trying to modify the code, but got the error listed in the title.Anyone please help. Error: The method segments() in the type BruteCollinearPoints is not applicable for the arguments (Point, Point) import java.util.Collections; import…
Bruce
  • 1
0
votes
1 answer

Segment Segment intersection in 3D

Let's suppose I have a triangle defined by three coordinates A, B and C and a line segment defined by two coordinates D and E in 3D euclidean space. Let's further suppose that the segment is intersecting the triangle. Now, I need to find out whether…
NMO
  • 748
  • 8
  • 16
0
votes
1 answer

convex hull of three orthogonal line segments

I got three line segments in 3D. They are pairwise orthogonal but they don't need to touch. If they touch, the volume of the convex hull of them is 1/6*s1*s2*s3 where s1,s2,s3 are the lengths of the line segments. This can be easily computed. But…
Nad
  • 13
  • 3
0
votes
0 answers

Draw a line in JPanel given co-ordinates of 2 points

I would like to plot the line, preferably a dashed segment at a time. Given the co-ordinates of the 2 end points, we can find the equation of the line right? And hence deduce all points(pixels) that lie on this line? But i'm having trouble with…
user234198
  • 36
  • 2
0
votes
1 answer

How to rotate a shape made up of line segments

Hello I am making a game in java. I am using a collection of lines to represent a shape to detect collisions. I need to be able to rotate this shape by degrees or radians As you can see from the diagram above the shape is a collection of line…
user2277362
  • 113
  • 1
  • 1
  • 9
-1
votes
1 answer

How do I find the intersection point of two line SEGMENTS, if one exists?

I have two line segments described as below: # Segment 1 ((x1, y1), (x2, y2)) # Segment 2 ((x1, y1), (x2, y2)) I need a way to find their intersection point if one exists, using no third-party modules. I know people have asked this question…
Bituvo
  • 72
  • 7
-1
votes
2 answers

Find most optimal algorithm for given problem

I'm trying to solve this problem from my textbook: When a frisbee is thrown into a bucket, it gets stuck where the inner diameter of the bucket is smaller than the outer diameter of the frisbee. Analyse where in the bucket the frisbees gets stuck…
-1
votes
1 answer

How to determine which grid cells will intersect central cell if two random points between any two cells are connected

I have a math puzzle/question In case of 3 x 3 gird, how can I determine which lines will intersect the center cell if we to connect two random points within two neighboring cells. Neighbor is defined by (grid_size - 1) / 2 = 1 where gird size is 3…
shaderology
  • 599
  • 3
  • 7
-1
votes
1 answer

How to check whether the given points are in the line segment or not?

How to check whether the given points are in the line segment or not? I used this at first: if (s == null) { return false; } if (!(s instanceof Point)) { return false; } return (x == ((Point) s).x && y == ((Point) s).y); but it didn't really…
M. A
  • 3
  • 2
-1
votes
1 answer

how to generate n samples from a line segment using Matlab

Given n samples of 100,how do we generate these random samples in the line segment below using matlab line_segement: x between -1 and 1, y=2
-2
votes
3 answers

how many line segments will intersect in a plane will intersect with a horizontal line ? what will be the most effective way to find this

I’m trying to solve this Cyberchef challenge: You are given N points in a plane (numbered 1 through N); for each valid i, the i-th point is Pi=(i,Ai). There are N−1 line segments between them (numbered 1 through N−1); for each valid i, the i-th…
user12856563
1 2 3 4 5
6