Questions tagged [intersection]

Intersection is a term that relates to descriptive geometry and functions. Intersections are points which are included in multiple objects. They are intersections of the object they belong to.

2483 questions
10
votes
2 answers

Finding the intersection between two series in Pandas using index

I have two series of different lengths, and I am attempting to find the intersection of the two series based on the index, where the index is a string. The end result is, hopefully, a series that has the elements of the intersection based on the…
Boss1295
  • 129
  • 1
  • 2
  • 9
10
votes
1 answer

Objective-C check if subviews of rotated UIViews intersect?

I don't know where to start with this one. Obviously CGRectIntersectsRect will not work in this case, and you'll see why. I have a subclass of UIView that has a UIImageView inside it that is placed in the exact center of the UIView: I then rotate…
Liftoff
  • 24,717
  • 13
  • 66
  • 119
10
votes
3 answers

Finding intersection points of two ellipses

I'm writing a basic 2D shape library in Python (primarily for manipulating SVG drawings), and I'm at a loss for how to efficiently calculate the intersection points of two ellipses. Each ellipse is defined by the following variables (all floats): c:…
mrjogo
  • 387
  • 1
  • 3
  • 12
10
votes
1 answer

Why does raytracer render spheres as ovals?

I've been hacking up a raytracer for the first time over the past few days. However, there are a few quirks which bother me and I don't really know how to work out. One that has been there since the beginning is the shape of spheres in the scene -…
user1845810
  • 123
  • 1
  • 7
10
votes
4 answers

Python: Jaccard Distance using word intersection but not character intersection

I didn't realize the that Python set function actually separating string into individual characters. I wrote python function for Jaccard and used python intersection method. I passed two sets into this method and before passing the two sets into my…
add-semi-colons
  • 18,094
  • 55
  • 145
  • 232
9
votes
2 answers

How to calculate the area of polygon overlap in R?

Does anyone know how to calculate the area in common between 2 or more polygons in R? I would like to have the output of such a calculation be the coordinates of a new polygon for that area of overlap. Cheers
Marc in the box
  • 11,769
  • 4
  • 47
  • 97
9
votes
1 answer

NetLogo two agentsets operations

I have two agentsets. Are there functions for finding: An agentset of agents that are present in both (intersection) An agentset of agents that are present in one and not the other I'm finding it very difficult to implement this by hand,…
Mikhail
  • 8,692
  • 8
  • 56
  • 82
9
votes
3 answers

Finding where two linear fits intersect in R

I have two linear fits that I've gotten from lm calls in my R script. For instance... fit1 <- lm(y1 ~ x1) fit2 <- lm(y2 ~ x2) I'd like to find the (x,y) point at which these two lines (fit1 and fit2) intersect, if they intersect at all.
CodeGuy
  • 28,427
  • 76
  • 200
  • 317
9
votes
8 answers

Intersection between a line and a sphere

I'm trying to find the point of intersection between a sphere and a line but honestly, I don't have any idea of how to do so. Could anyone help me on this one ?
Tanguy
  • 91
  • 1
  • 1
  • 2
9
votes
1 answer

Type intersections using any

From https://github.com/Microsoft/TypeScript/pull/3622: Supertype collapsing: A & B is equivalent to A if B is a supertype of A. However: type a = string & any; // Resolves to any, not string!? This intersection resolves to any. Isn't 'any' a…
CRice
  • 29,968
  • 4
  • 57
  • 70
9
votes
3 answers

Enhance performance of geopandas overlay(intersection)

I have two sets of shapefiles with polygons. One set of shapefile is just the US counties I'm interested in and this varies across firms and years. The other set of shapefile is the business area of firms and of course this varies across firms and…
Crystie
  • 385
  • 6
  • 12
9
votes
2 answers

Get bounding box of SVG path

I want exactly what this page do http://codepen.io/netsi1964/full/vNoemp/ I have the path and need to know it's bounding box as a rect element, it's x,y,width and height given code
rafat mansour
  • 103
  • 1
  • 1
  • 6
9
votes
4 answers

Get intersection of a multi-dimensional array in PHP

Starting Point I have a multi-dimensional array, like the follow example: $array = array ( 'role_1' => array ( 0 => 'value_2', 1 => 'value_3', ), 'role_2' => array ( 0 => 'value_1', 1 => 'value_2', ), 'role_3' => …
bueltge
  • 2,294
  • 1
  • 29
  • 40
9
votes
7 answers

Ruby - array intersection (with duplicates)

I have array(1 and 2). How can I get array3 from them? array1 = [2,2,2,2,3,3,4,5,6,7,8,9] array2 = [2,2,2,3,4,4,4,4,8,8,0,0,0] array3 = [2,2,2,3,4,8] array1 & array2 returns [2,3,4,8], but I need to hold onto the duplicates.
9
votes
2 answers

JavaFX 8 3D scene intersection point

Is it possible in a JavaFX 8 3D scene to find points along a ray (e.g. PickRay), starting at an arbitrary point in 3D space with some 3D direction vector, where the ray intersects the triangles in a mesh (TriangleMesh inside a MeshView)? I know this…
Rik
  • 351
  • 2
  • 10