area

Compute the area of intersection between a circle and a triangle?

北战南征 提交于 2019-12-17 10:29:09
问题 How does one compute the area of intersection between a triangle (specified as three (X,Y) pairs) and a circle (X,Y,R)? I've done some searching to no avail. This is for work, not school. :) It would look something like this in C#: struct { PointF vert[3]; } Triangle; struct { PointF center; float radius; } Circle; // returns the area of intersection, e.g.: // if the circle contains the triangle, return area of triangle // if the triangle contains the circle, return area of circle // if

Calculating the area under a curve given a set of coordinates, without knowing the function

时光总嘲笑我的痴心妄想 提交于 2019-12-17 10:16:49
问题 I have one list of 100 numbers as height for Y axis, and as length for X axis: 1 to 100 with a constant step of 5. I need to calculate the Area that it is included by the curve of the (x,y) points, and the X axis, using rectangles and Scipy. Do I have to find the function of this curve? or not? ... almost all the examples I have read are about a specific equation for the Y axis. In my case there is no equation, just data from a list. The classic solution is to add or the Y points and multiple

Combined area of overlapping circles

冷暖自知 提交于 2019-12-17 06:59:27
问题 I recently came across a problem where I had four circles (midpoints and radius) and had to calculate the area of the union of these circles. Example image: For two circles it's quite easy, I can just calculate the fraction of the each circles area that is not within the triangles and then calculate the area of the triangles. But is there a clever algorithm I can use when there is more than two circles? 回答1: Find all circle intersections on the outer perimeter (e.g. B,D,F,H on the following

MATLAB: integrate and shade area under curve (no function)

允我心安 提交于 2019-12-13 21:57:55
问题 I need to integrate the area under the curve between two known X values. The index values do not correspond to the actual x values (e.g. a data point at 3 seconds is not at position 3 in the array). I realised this when attempting: time=[0.1,1.5,2.1,3.2,4.5,6]; traceVect=[0,0.1,1,2,3.0,2.9]; hold on plot(time,traceVect,'k'); t0=1; td=5; time = time(1,[t0:td]); traceVect = traceVect(1,[t0:td]); area(time,traceVect,'FaceColor','g'); a = trapz(time,traceVect); Which produces the plot: For

Mysql geometry AREA() function returns what exactly when coords are long/lat?

China☆狼群 提交于 2019-12-13 19:26:54
问题 My question is somewhat related to this similar one, which links to a pretty complex solution - but what I want to understand is the result of this: Using a Mysql Geometry field to store a small polygon I duly ran select AREA(myPolygon) where id =1 over it, and got an value like 2.345. So can anyone tell me, just what does that number represent seeing as the stored values were long/lat sets describing the polygon? FYI, the areas I am working on are relatively small (car parks and the like)

Shade and calculate specific area

谁说我不能喝 提交于 2019-12-13 15:38:15
问题 I tried to change the code in a way so that only the first area is shaded grey. How can I set the horizontal line in a way that it only appears under the area I want to shade? Furthermore I want to calculate the area of ONE region. How do I achieve that? I know it is trapz but I am not sure how to set the boundaries. Thanks! x = 0:.01:4*pi; %// x data y = sin(x); %// y data level = 0.5; %// level plot(x, y) hold on area(x, max(y, level), level, 'EdgeColor', 'none', 'FaceColor', [.7 .7 .7])

gnuplot: fill area curve keeping tics on top

久未见 提交于 2019-12-13 12:28:57
问题 in gnuplot, when you try to fill an area under a curve, the tics of both axes are hinded behind the solid area. Is there any way to give them to the front? I am using postcript terminal, where no transparent features are allowed (i guess) Thanks 回答1: There sure is! Before plotting, run this interactively or in a script: set tics front Try help tics interactively for more info. 回答2: After trying many options I realized that the following works properly: set tics front It seems important to

Area under surface between two curves [duplicate]

拜拜、爱过 提交于 2019-12-13 10:25:50
问题 This question already has an answer here : Area between line and curve (no function) (1 answer) Closed 3 years ago . I want to determine the area between the red line and the blue line but only to the y-value of 4.559. How can I achieve that? 回答1: In general: First you have to subtract the two functions from each other. After that, you have a function that represents the delta in y for each point on the x-axis. After that you have to calculate the integral, for matlab you should look here

how to insert div directly in tag href area shape

久未见 提交于 2019-12-13 08:36:30
问题 I wish to know if it is possible to insert following divs <div id="cal1"> [dopbsp id="1" lang=it]</div> <div id="cal2"> [dopbsp id="1" lang=it]</div> <div id="cal3"> [dopbsp id="1" lang=it]</div> directly in the tag href image map linked by different shape areas as following <area shape="circle" coords="160,59,20" href="#"> <area shape="circle" coords="111,58,20" href="#"> <area shape="circle" coords="60,59,20" href="#"> so that when I click on shape area, for example <area shape="circle"

How to trace the surface area as well as smoothen a specific region in an image using MATLAB

♀尐吖头ヾ 提交于 2019-12-13 08:26:21
问题 I have an image with 6 colors each indicating a value. I had obtained an image as shown below. I need to smoothen the edges and then find out the area as well as the surface area of that region. The second image shows a black line drawn in the edges which indicates that I need to smoothen the edges in such a way. I had used segmentation to create a mask as shown in the third image, and then obtain a segmented image using the code following the image. I have used the following code for