CR4 - The Engineer's Place for News and Discussion®

Previous in Forum: Hot Water Heater Again   Next in Forum: Skydiver Felix Baumgartner Breaks Sound Barrier
Close

Comments Format:






Close

Subscribe to Discussion:

CR4 allows you to "subscribe" to a discussion
so that you can be notified of new comments to
the discussion via email.

Close

Rating Vote:







43 comments
Power-User

Join Date: Oct 2008
Location: Gujarat, India
Posts: 153

Area Between Two Intersecting Circles

10/13/2012 1:11 AM

Hello, I need to find out the area between two circle having different radius. Both circle are on third circle's arc. First circle is fixed and Second is moving on the trajectory of third circle's arc. I want to find out the area between the first and second circle when second circle tries to come closer to first circle. Radius relation are R1<R2<R3. How should I proceed? Problem will be simpler if two circle are on same line but here both circle (first and second) are on arc of third circle and second circle is approaching towards first circle which is fixed!. Can any one suggest me?

__________________
Paresh B. Gujarati
Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

Comments rated to be Good Answers:

These comments received enough positive ratings to make them "good answers".

Comments rated to be "almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, rate them!
Guru

Join Date: Oct 2007
Location: India
Posts: 1259
Good Answers: 33
#1

Re: Area between two intersecting circles

10/13/2012 3:41 AM

Could not you upload a sketch?

Register to Reply
Power-User

Join Date: Oct 2008
Location: Gujarat, India
Posts: 153
#3
In reply to #1

Re: Area between two intersecting circles

10/13/2012 5:59 AM

You will now get the idea, What I mean to say.

__________________
Paresh B. Gujarati
Register to Reply Score 1 for Good Answer
Guru

Join Date: Oct 2007
Location: India
Posts: 1259
Good Answers: 33
#4
In reply to #3

Re: Area between two intersecting circles

10/13/2012 7:44 AM

That is better. Thank you, Paresh. Now, the comments at #2 "This implies a function of time. In this case, you have to define the rate of movement of the second circle towards the first circle." still applies. Could you clarify further?

Register to Reply
Power-User

Join Date: Oct 2008
Location: Gujarat, India
Posts: 153
#5
In reply to #4

Re: Area between two intersecting circles

10/13/2012 8:42 AM

I will move the second circle in very small increment of angle and corresponding to that I will calculate the intersection points between two circles. These two points will be the limit of integration of double integral. I am doing these thing. Let us see.

__________________
Paresh B. Gujarati
Register to Reply
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 2489
Good Answers: 70
#6
In reply to #5

Re: Area between two intersecting circles

10/13/2012 10:30 AM

If you have 2 intersecting circles as shown in #2, and you know the distance between the centres (which you must or there is no unique answer) there is no need for integration. The area consists of a sector of each circle. Use the formula for area of the sector for each, and add them together.

__________________
Give masochists a fair crack of the whip
Register to Reply Score 1 for Good Answer
Guru
Technical Fields - Technical Writing - New Member Engineering Fields - Piping Design Engineering - New Member

Join Date: May 2009
Location: Ketchikan, AK, USA
Posts: 15841
Good Answers: 621
#7
In reply to #6

Re: Area between two intersecting circles

10/13/2012 11:37 AM

Minor correction: segment rather than sector of each circle.

--Ed. C.

__________________
In vino veritas; in cervisia carmen; in aqua E. coli.
Register to Reply
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 2489
Good Answers: 70
#10
In reply to #7

Re: Area between two intersecting circles

10/13/2012 3:07 PM

Yes of course. Correction accepted.

__________________
Give masochists a fair crack of the whip
Register to Reply
Power-User
Engineering Fields - Mechanical Engineering - New Member Kenya - Member - New Member

Join Date: Sep 2008
Location: Eldoret, Kenya
Posts: 141
Good Answers: 6
#8
In reply to #6

Re: Area between two intersecting circles

10/13/2012 12:10 PM

"...there is no need for integration. The area consists of a sector of each circle. Use the formula for area of the sector for each, and add them together."

True. You do not necessarily need to use an intergral to calculate the area. However, an intergral will be most appropriate when this segment is too small.

Also, and this is my subjective opinion, intergartion is less cumbersome than calculating the areas of the segment than adding them. Intergration does this in one neat step.

__________________
Technology solves problems we didn't know existed, or didn't realise that they needed to be solved. Tinkering is therefore never pointless.
Register to Reply Off Topic (Score 5)
Power-User
Engineering Fields - Mechanical Engineering - New Member Kenya - Member - New Member

Join Date: Sep 2008
Location: Eldoret, Kenya
Posts: 141
Good Answers: 6
#9
In reply to #5

Re: Area between two intersecting circles

10/13/2012 12:44 PM

"I will move the second circle in very small increment of angle and corresponding to that I will calculate the intersection points between two circles."

This is much clearer.

Peharps if the second circle moves at 1o steps (which would require 360 steps to circumnavigate the perimeter) then the area of the segment at each step can be found.

Hypothesis (*drum roll please*):

If

[n­th] o= (Area of segment) x

then x is constant and greater than 1.

Where ∆[n­th] o is the change of position of the second circle for each step, n.

I would love for you to prove me right or wrong!

__________________
Technology solves problems we didn't know existed, or didn't realise that they needed to be solved. Tinkering is therefore never pointless.
Register to Reply Off Topic (Score 4)
Guru
Technical Fields - Technical Writing - New Member Engineering Fields - Piping Design Engineering - New Member

Join Date: May 2009
Location: Ketchikan, AK, USA
Posts: 15841
Good Answers: 621
#11
In reply to #9

Re: Area between two intersecting circles

10/13/2012 7:21 PM

That is so confused it isn't even wrong, much less right.

Integration will likely prove very awkward, much more so than direct geometry.

__________________
In vino veritas; in cervisia carmen; in aqua E. coli.
Register to Reply
Power-User

Join Date: Nov 2011
Posts: 476
Good Answers: 13
#22
In reply to #9

Re: Area between two intersecting circles

10/14/2012 6:02 PM

You can prove yourself wrong or right. Below is example with correct value for area.

R1: 1.25in

R2: 1.5in

R3: 2.5in

Angle: 45deg--> area = 1.13293in2 (chord length= 1.91342in)

Angle: 46deg--> area = 1.0549in2 (chord length= 1.95366in)

See if you calcs are correct.

Register to Reply Off Topic (Score 5)
Guru
Technical Fields - Technical Writing - New Member Engineering Fields - Piping Design Engineering - New Member

Join Date: May 2009
Location: Ketchikan, AK, USA
Posts: 15841
Good Answers: 621
#23
In reply to #22

Re: Area between two intersecting circles

10/14/2012 6:11 PM

Was that done analytically, or by a drafting program that computes areas?

__________________
In vino veritas; in cervisia carmen; in aqua E. coli.
Register to Reply
Power-User

Join Date: Nov 2011
Posts: 476
Good Answers: 13
#24
In reply to #23

Re: Area between two intersecting circles

10/14/2012 6:22 PM

Drafting program.

Register to Reply
Power-User

Join Date: Oct 2008
Location: Gujarat, India
Posts: 153
#30
In reply to #22

Re: Area between two intersecting circles

10/15/2012 12:03 AM

Thanks man for your efforts and help. Can you tell me whether it can be calculated by programming or not. By calculation off course. I need to put this in programming for design of rotary valve.

__________________
Paresh B. Gujarati
Register to Reply Off Topic (Score 5)
Guru

Join Date: Jun 2009
Location: Bangalore, India
Posts: 715
Good Answers: 25
#13
In reply to #3

Re: Area between two intersecting circles

10/14/2012 12:54 AM

The centres of red and black are on a chord of the blue. Knowing the angular separation the chord can be calculated. Likewise the common chord between the red and the black. Using that the common area can be arrived at.

__________________
bioramani
Register to Reply Score 1 for Good Answer
Power-User

Join Date: May 2009
Location: CORDOBA ARGENTINA
Posts: 150
Good Answers: 3
#25
In reply to #3

Re: Area between two intersecting circles

10/14/2012 10:29 PM

As I allways, as possible, work in acad with LISP , I made one that return me a list with all the area values for a 1º degree rotation meanwhile there is a area .

Seem to be no other kind of file can be uploaded.

By private message

__________________
devitg
Register to Reply
Power-User

Join Date: Oct 2008
Location: Gujarat, India
Posts: 153
#26
In reply to #25

Re: Area between two intersecting circles

10/14/2012 11:46 PM

Thank you. Actually I want this area calculation at each angle increment in programming with C. I need to put this area in design of rotary valve. Do you have idea?

__________________
Paresh B. Gujarati
Register to Reply
Power-User

Join Date: May 2009
Location: CORDOBA ARGENTINA
Posts: 150
Good Answers: 3
#27
In reply to #26

Re: Area between two intersecting circles

10/14/2012 11:54 PM

I only handle LISP , if you give me your constraint I can gige the result .

Base blue Diameter

Fixed black diameter, and is angle from X axis

To rotate RED diameter , start angle from X axis and end angle .

Angle step

Sure you have some ACAD. you can solve by it.

I sent you a private message, please answer it.

__________________
devitg
Register to Reply
Power-User
Engineering Fields - Mechanical Engineering - New Member Kenya - Member - New Member

Join Date: Sep 2008
Location: Eldoret, Kenya
Posts: 141
Good Answers: 6
#2

Re: Area between two intersecting circles

10/13/2012 4:29 AM

I suppose you mean the area of the shape formed when the two circles overlap.

If this is so, then a simple intergral subtraction (based on a cartesian coordinate) of the formulars of the two circles will suffice. In this case, the third circle isnt even included in the calculation.

However, you mention one circle being fixed, another in motion towards the first and this motion being about the arc of a third circle. This implies a fuction of time.

In this case, you have to define the rate of movement of the second circle towards the first circle.

The area will then be a function of not only the formulars of the circles but of time as well. Otherwise, the area will be at a certain value at a certain time, t, based on the rate of the second circle's advancement towards the first.

Peharps, I have the wrong mental image of what you describe. In this case, I agree with the Joshi: Include a drawing!

__________________
Technology solves problems we didn't know existed, or didn't realise that they needed to be solved. Tinkering is therefore never pointless.
Register to Reply Score 1 for Good Answer
Power-User

Join Date: May 2009
Location: CORDOBA ARGENTINA
Posts: 150
Good Answers: 3
#12

Re: Area Between Two Intersecting Circles

10/13/2012 11:09 PM

Do both center , the red and the black , lay on the blue circunference??

In wich way you want the rusult come form

__________________
devitg
Register to Reply
Power-User

Join Date: Oct 2008
Location: Gujarat, India
Posts: 153
#15
In reply to #12

Re: Area Between Two Intersecting Circles

10/14/2012 2:51 AM

Yes. Red's and black's centre are on circumference on blue circle.

__________________
Paresh B. Gujarati
Register to Reply
Guru
Engineering Fields - Marine Engineering - New Member

Join Date: May 2007
Location: Australia.
Posts: 1129
Good Answers: 43
#14

Re: Area Between Two Intersecting Circles

10/14/2012 2:49 AM

(1) The distance between the two smaller circles is a cord of the largest circle, the lenght of which can be found by, [ cord = (R1x2) x sine(A/2) ], where A is the nominated angle between smaller circles centres.

(2) The two radius R2 and R3 plus above cordal lenght between the two smaller circles form a triangle the height of which is half the distance between the points that the two circles intersect each other.

(3) Having the distance between the two intersection of the of the small circles. it is then a matter of calculating the two angles in the small circles, being found from the above triangle having sides equal to the cord plus R2 and R3.

(4) From there the solution is only a matter of calculating the area of the two small circle segments minus the area of the two triangle having sides equal the distance between the circles intersections and there radius.

Regards JD.

Register to Reply Score 2 for Off Topic
Power-User

Join Date: Oct 2008
Location: Gujarat, India
Posts: 153
#16
In reply to #14

Re: Area Between Two Intersecting Circles

10/14/2012 3:01 AM

Thank you JD. I did it before but the problem is changing the length of common intersection and it is not uniform. If we have the relationship between length of intersection or angle we can get the area.

__________________
Paresh B. Gujarati
Register to Reply
Guru

Join Date: Jun 2009
Location: Bangalore, India
Posts: 715
Good Answers: 25
#17
In reply to #16

Re: Area Between Two Intersecting Circles

10/14/2012 3:10 AM

From the angle of separation between the centres of the black and the red the chord of the blue can be calculated knowing the blue radius. This chord and the radii of back and red form a triangle. The altitude of this triangle is half the common chord between the black and blue.

__________________
bioramani
Register to Reply
Guru

Join Date: Jun 2009
Location: Bangalore, India
Posts: 715
Good Answers: 25
#18
In reply to #17

Re: Area Between Two Intersecting Circles

10/14/2012 7:17 AM

quote: The altitude of this triangle is half the common chord between the black and blue. Endquote

That was an error. Should have been 'between the black and red'

__________________
bioramani
Register to Reply
Power-User

Join Date: Apr 2008
Location: Baltimore
Posts: 121
Good Answers: 3
#19

Re: Area Between Two Intersecting Circles

10/14/2012 9:13 AM

Try to visualize the two circles on a line (which as you said is easier). The line is the chord between the two smaller circles centerpoints. The chord of course also connects the two points on the arc of the other circle. That should get you started.

Register to Reply Score 1 for Good Answer
Power-User

Join Date: May 2009
Location: CORDOBA ARGENTINA
Posts: 150
Good Answers: 3
#20

Re: Area Between Two Intersecting Circles

10/14/2012 12:24 PM

Which are your result constraints .

How many rotation , at what angle step, you want .

In which way yo want the result to come.

Maybe a e coma separated value file , so then you can handle by a spread sheet.?

__________________
devitg
Register to Reply Score 1 for Off Topic
Guru
Technical Fields - Technical Writing - New Member Engineering Fields - Piping Design Engineering - New Member

Join Date: May 2009
Location: Ketchikan, AK, USA
Posts: 15841
Good Answers: 621
#21

Re: Area Between Two Intersecting Circles

10/14/2012 1:06 PM

There are at least two ways to describe the movement of Circle 2 wrt Circle 1: 1) Uniform movement along the chord between their centers, and 2) Uniform movement along the arc of the large circle. These will give slightly different results, but it needs to be decided which.

__________________
In vino veritas; in cervisia carmen; in aqua E. coli.
Register to Reply
Guru
Technical Fields - Technical Writing - New Member Engineering Fields - Piping Design Engineering - New Member

Join Date: May 2009
Location: Ketchikan, AK, USA
Posts: 15841
Good Answers: 621
#28

Re: Area Between Two Intersecting Circles

10/14/2012 11:56 PM

It would simplify your problem to have equal radii for the smaller circles. For flow purposes, there is no good reason to have one larger than the other. Also, for practical purposes, the moving circle can be assumed to follow a straight line segment; this too would simplify the calculations.

__________________
In vino veritas; in cervisia carmen; in aqua E. coli.
Register to Reply
Power-User

Join Date: Oct 2008
Location: Gujarat, India
Posts: 153
#29

Re: Area Between Two Intersecting Circles

10/14/2012 11:59 PM

Now, I found a way to calculate the area by integration if it works. The method is, I will find out the two common intersecting point P and Q based on the equation of first two circle (1&2). By calculation we will get P and Q. Now we have limit of integration for region between two circle i.e. intersection region. (See the figure)

Now I want to use integral concept to find out the area. The intersection points keep on changing as I change the 'theta' and corresponding to that limit will change and hence area. Now what should be the function that I need to integrate for it?

Can anybody help me?

The equation of fixed circle is (x-0)2+(y-R)2=r12 , where r1=radius of first circle i.e. fixed

The equation of second rotating circle is (x-Rcos(theta))2-(y-Rsin(theta))2=r22

Second thing, I do I integrate these two equation to find the area between them? I will have limit of integration i.e. intersection points.

And,

Last, Is there any means by which I could implement this in C programming?

__________________
Paresh B. Gujarati
Register to Reply
Guru
Technical Fields - Technical Writing - New Member Engineering Fields - Piping Design Engineering - New Member

Join Date: May 2009
Location: Ketchikan, AK, USA
Posts: 15841
Good Answers: 621
#31
In reply to #29

Re: Area Between Two Intersecting Circles

10/15/2012 12:07 AM

You should not use integration at all, that will be way more complicated than intermediate geometry.

__________________
In vino veritas; in cervisia carmen; in aqua E. coli.
Register to Reply
Power-User

Join Date: Sep 2011
Posts: 164
Good Answers: 1
#32

Re: Area Between Two Intersecting Circles

10/15/2012 6:25 AM

I'm not real good at math or geometry for that matter, so I hope I don't get beat up for this. But I just couldn't resist giving this one a shot. I really don't know the proper way to write this using a keyboard, but I'll try to put it down as an equation.

This is what I came up with:

(((r1 + r2 - (2 * r3 * sin(dg3 / 2)) / (2 * r3 * sin(dg3 / 2))) * ((r1 * pi + r2 * pi) / 2)

I'm sure it's not structured the best, but i think it's something that can work in code.

My terms are- r1=the black circle radius; r2=the red circle radius; r3=the blue circle radius; and dg3=the degree of separation between c1 and c2's center-points on c3's circumference.

Register to Reply
3
Guru

Join Date: Aug 2005
Location: Hemel Hempstead, UK
Posts: 3372
Good Answers: 164
#33

Re: Area Between Two Intersecting Circles

10/15/2012 2:10 PM

If you PM me with your E-M address I will send the spread sheet

You can set the values of L, R & r

beta is just half of theta

In the above the first two lines correspond to angles where the circles don't meet.

__________________
We are alone in the universe, or, we are not. Either way it's incredible... Adapted from R. Buckminster Fuller/Arthur C. Clarke
Register to Reply Good Answer (Score 3)
Power-User

Join Date: Nov 2011
Posts: 476
Good Answers: 13
#34
In reply to #33

Re: Area Between Two Intersecting Circles

10/15/2012 4:49 PM

I'm impressed. GA from me. I didn't really pay attention to the math part but it looks impressive.

Register to Reply
Power-User

Join Date: Oct 2008
Location: Gujarat, India
Posts: 153
#35
In reply to #33

Re: Area Between Two Intersecting Circles

10/15/2012 11:51 PM

Thank you for your efforts but What I want is to have area of intersection when first two circle are on curve/arc of third circle...This needs either complex maths/geometry or integration.

__________________
Paresh B. Gujarati
Register to Reply Score 1 for Off Topic
Guru
Technical Fields - Technical Writing - New Member Engineering Fields - Piping Design Engineering - New Member

Join Date: May 2009
Location: Ketchikan, AK, USA
Posts: 15841
Good Answers: 621
#36
In reply to #35

Re: Area Between Two Intersecting Circles

10/15/2012 11:56 PM

In the diagram, points A and B are on the large circle (which isn't drawn); the angles θ/2 are at the center.

Once again, this does not need complex maths or integration.

__________________
In vino veritas; in cervisia carmen; in aqua E. coli.
Register to Reply
Guru

Join Date: Aug 2005
Location: Hemel Hempstead, UK
Posts: 3372
Good Answers: 164
#37
In reply to #35

Re: Area Between Two Intersecting Circles

10/16/2012 6:13 AM

As Tornado says L is the radius of the larger circle. There is no maths here, it's simple arithmetic.

__________________
We are alone in the universe, or, we are not. Either way it's incredible... Adapted from R. Buckminster Fuller/Arthur C. Clarke
Register to Reply
Guru
Engineering Fields - Nuclear Engineering - New Member

Join Date: Sep 2009
Location: Louisville, OH
Posts: 770
Good Answers: 15
#38
In reply to #35

Re: Area Between Two Intersecting Circles

10/16/2012 6:18 PM

As pointed out, when the centers of the small circles lie anyplace on the big circle, a straight line can be drawn between the two centers. The line length will be somewhat less than the arc length, but it makes the problem doable even if not quite elementary.

__________________
Lehman57
Register to Reply
Power-User

Join Date: Nov 2011
Posts: 476
Good Answers: 13
#39
In reply to #35

Re: Area Between Two Intersecting Circles

10/16/2012 6:44 PM

Paresh, I think you're misunderstanding Randall's diagram. See below how your circle (blue) fits with Randall's diagram and calculations.

Register to Reply Score 1 for Good Answer
Guru

Join Date: Feb 2012
Location: just died off here
Posts: 518
Good Answers: 1
#40
In reply to #35

Re: Area Between Two Intersecting Circles

10/17/2012 4:12 PM

i don't think so - with complex function you have to take extra care of imaginary results or how you interpret them it's basic trigonometry

all you need to know is distance of the centers of the red and black circle - as a function of their position on blue?? one - when in computer program

u chk::

if( (R.red+R.black) >= module.orDistanceOf(vector.2theCenterOftheRedCircle(coordinates)-vector.2centerOfBlackCircle(coordinates)) ){then /*we have an intersection of 0m2 to max area and you calculate it finding the arcs and triagles formed by cut points that are the function of the distance in between the centers of those circles .(dot) & done */ your algorithm }else{/* the intersection like condition in hyperspace might exist - NOW you need to define a generalized complex and 3D t.m. ?6D function to make any sense of it - likely it's not what you should utilize & u can omit the else computation */}

Register to Reply Score 1 for Off Topic
Guru

Join Date: Feb 2012
Location: just died off here
Posts: 518
Good Answers: 1
#41
In reply to #40

Re: Area Between Two Intersecting Circles

10/17/2012 4:32 PM

http://www.regentsprep.org/regents/math/geometry/GP14/CircleSectors.htm

by(https://www.google.ee/#hl=et&sclient=psy-ab&q=find+the+area+of+the+sector+of+a+circle+formula&oq=find+the+area+of+the+sector+of+a+circle+formula&gs_l=hp.3...11781.13625.3.13906.7.4.0.0.0.0.766.1968.2-2j6-2.4.0...0.0...1c.1.gTHVqaokVY0&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=2295828129da0630&bpcl=35440803&biw=1280&bih=836)

the complex circle function is by the way |z| = R , R is positive real number |z| = √(Im(z)² + Re(z)²)

& here's some of it in Visual basic - converting to C or ++ shouldn't be much of an effort (not all of it working at voluntary input such as extra big or small numbers)

' ------- Math. Geom. support -------

' ------- BaseMath. -------

Private Function FRM(ByVal i As String, ByVal l) As String
Dim cl: cl = Len(i)
If l > cl Then
FRM = String(l - cl, "0") + i
Else
FRM = i
End If
End Function

Private Function BIN(ByVal i As Long) As String
If i > 1 Then BIN = BIN(i \ 2) + Chr(&H30 + i Mod 2) Else BIN = Chr(&H30 + i)
End Function

Private Function QDR(ByVal i As Long) As String
If i > 3 Then QDR = QDR(i \ 4) + Chr(&H30 + i Mod 4) Else QDR = Chr(&H30 + i)
End Function

Private Function OCT(ByVal i As Long) As String
If i > 7 Then OCT = OCT(i \ 8) + Chr(&H30 + i Mod 8) Else OCT = Chr(&H30 + i)
End Function

Private Function HH(ByVal i As Long) As Long
HH = i - (i > 9) * 7
End Function

Private Function HEX(ByVal i As Long) As String
If i > 15 Then HEX = HEX(i \ 16) + Chr(&H30 + HH(i And &HF&)) Else HEX = Chr(&H30 + HH(i And &HF&))
End Function

Private Function HEXL(ByVal i As Long) As String
HEXL = HEX(i \ 65536) + HEX(i And 65535)
End Function

Private Function DCS(ByVal i As Long) As String
If i > 9 Then DCS = DCS(i \ &HA) + Chr(&H30 + i Mod &HA) Else DCS = Chr(&H30 + i)
End Function

Private Function DCI(ByVal i As Long) As String
If i < 0 Then DCI = "-" + DCS(-i) Else DCI = " " + DCS(i)
End Function

' ------- BaseMath. -------

Private Function getVarTypeInfo(ByVal ID) As String
Dim xID, rr$
Dim parNfo(15) As Variant
parNfo(0) = Array("vbEmpty", 0, "Empty (uninitialized)")
parNfo(1) = Array("vbNull", 1, "Null (no valid data)")
parNfo(2) = Array("vbInteger", 2, "Integer")
parNfo(3) = Array("vbLong", 3, "Long integer")
parNfo(4) = Array("vbSingle", 4, "Single-precision floating-point number")
parNfo(5) = Array("vbDouble", 5, "Double-precision floating-point number")
parNfo(6) = Array("vbCurrency", 6, "Currency")
parNfo(7) = Array("vbDate", 7, "Date")
parNfo(8) = Array("vbString", 8, "String")
parNfo(9) = Array("vbObject", 9, "OLE Automation object")
parNfo(10) = Array("vbError", 10, "Error")
parNfo(11) = Array("vbBoolean", 11, "Boolean")
parNfo(12) = Array("vbVariant", 12, "Variant (used only with arrays of Variants)")
parNfo(13) = Array("vbDataObject", 13, "Non-OLE Automation object")
parNfo(14) = Array("vbByte", 17, "Byte")
parNfo(15) = Array("vbArray", 8192, "Array")
If ID > 13 Then
Select Case ID
Case 17: xID = 14
Case 8192: xID = 15
Case Else: xID = 0
End Select
ID = xID
End If
rr = parNfo(ID)(0) & " , " & _
parNfo(ID)(1) & " , " & _
parNfo(ID)(2)
getVarTypeInfo = rr
End Function

Private Sub INC_old(ParamArray uiv())
Dim l, m, c, X
l = LBound(uiv, 1)
m = UBound(uiv, 1)
MsgBox " Low ... Hi = " & l & " ... " & m
For c = l To m
X = VarType(uiv(c))
MsgBox c & vbLf & getVarTypeInfo(X)
Next c
End Sub

Private Sub INC_new(ByRef n0 As Variant, Optional n1 As Variant)
Dim l, m, c, X, uiv(1)
uiv(0) = n0
uiv(1) = n1
l = LBound(uiv, 1)
m = UBound(uiv, 1)
MsgBox " Low ... Hi = " & l & " ... " & m
For c = l To m
X = VarType(uiv(c))
MsgBox c & vbLf & getVarTypeInfo(X) & vbLf & uiv(c)
Next c
n0 = n0 + n1
End Sub

Private Sub INC(ByRef n0 As Variant, Optional n1 As Variant)
'MsgBox VarType(n1)
'MsgBox VarType(n1) & "=[" & n1 & "]"
Dim TpsT
TpsT = VarType(n1)
If TpsT = 10 Then n1 = 1
n0 = n0 + n1
End Sub

Private Sub DEC(ByRef n0 As Variant, Optional n1 As Variant)
Dim TpsT
TpsT = VarType(n1)
If TpsT = 10 Then n1 = 1
n0 = n0 - n1
End Sub

Private Function Round#(ByVal X#): X = (2 * (X < 0) + 1) * (Abs(X) + 0.5): Round = Fix(X): End Function
Private Function LRound&(ByVal X#): X = (2 * (X < 0) + 1) * (Abs(X) + 0.5): LRound = Fix(X): End Function

' ------- Cmplx -------

Private Function zRe(ByRef z As Cmplx) As Double
zRe = z.X
End Function

Private Function zIm(ByRef z As Cmplx) As Double
zIm = z.Y
End Function

Private Function zMdl(ByRef z As Cmplx) As Double
zMdl = Sqr(z.X ^ 2 + z.Y ^ 2)
End Function

Private Function zArg(ByRef z As Cmplx) As Double
Dim fi#
If z.X = 0# Then
If z.Y = 0# Then zArg = 0 Else zArg = (1 + 2 * (z.Y < 0)) * Pi / 2
Else
If z.X < 0# Then
fi = Pi + Atn(z.Y / z.X)
zArg = fi + 2 * Pi * (fi > Pi)
Else
zArg = Atn(z.Y / z.X)
End If
End If
End Function

Private Sub zZer(ByRef z As Cmplx)
With z: .X = 0#: .Y = 0#: End With
End Sub

Private Sub zEqu(ByRef z As Cmplx, ByVal X#, ByVal Y#)
z.X = X: z.Y = Y
End Sub

Private Sub zRev(ByRef z As Cmplx)
With z: .X = -.X: .Y = -.Y: End With
End Sub

Private Sub zInv(ByRef z As Cmplx)
Dim w As Cmplx
w.Y = z.X ^ 2 + z.Y ^ 2
If w.Y = 0# Then
w.X = -z.Y / 2 * Pi: w.Y = -z.X / 2 * Pi
Else
w.X = z.X / w.Y: w.Y = -z.Y / w.Y
End If
z = w
End Sub

Private Sub zAdd(ByRef z As Cmplx, ByRef v As Cmplx)
z.X = z.X + v.X: z.Y = z.Y + v.Y
End Sub

Private Sub zSub(ByRef z As Cmplx, ByRef v As Cmplx)
z.X = z.X - v.X: z.Y = z.Y - v.Y
End Sub

Private Sub zSwp(ByRef z As Cmplx, ByRef v As Cmplx)
Dim X As Cmplx
X = z: z = v: v = X
End Sub

Private Sub zMlt(ByRef z As Cmplx, ByVal X#)
z.X = X * z.X: z.Y = X * z.Y
End Sub

Private Sub zMul(ByRef z As Cmplx, ByRef v As Cmplx)
Dim X#
X = z.X * v.X - z.Y * v.Y: z.Y = z.X * v.Y + z.Y * v.X: z.X = X
End Sub

Private Sub zDiv(ByRef z As Cmplx, ByRef v As Cmplx)
Dim X#, Y#
X = z.X * v.X - z.Y * v.Y: Y = z.X * v.Y + z.Y * v.X: Call zEqu(z, X, Y)
X = v.X ^ 2 + v.Y ^ 2: Call zMlt(z, 1 / X)
End Sub

Private Sub zExp(ByRef z As Cmplx)
Dim a#, m#
m = Exp(z.X): a = zArg(z): z.X = m * Cos(a): z.Y = m * Sin(a)
End Sub

Private Sub zLn(ByRef z As Cmplx)
Dim w As Cmplx
w.X = Log(zMdl(z)): w.Y = zArg(z): z = w
End Sub

Private Sub zPow(ByRef z As Cmplx, ByRef p As Cmplx)
Dim a#, az#, m#, mz#
m = zMdl(z)
If m > 0# Then
m = Log(m): a = zArg(z): az = p.X * a + p.Y * m: mz = Exp(p.X * m - p.Y * a)
Else
m = 2 * Pi: a = Atn(1): az = p.X * (2 * Pi + a): mz = Exp(p.Y * (2 * Pi - a))
End If
z.X = mz * Cos(az): z.Y = mz * Sin(az)
End Sub

Private Sub zEmb(ByRef z As Cmplx, p As Cmplx)
Call zLn(p): Call zPow(z, p)
End Sub

Private Sub zRot(ByRef z As Cmplx, ByVal B#)
Dim a#, m#
m = zMdl(z): a = zArg(z) + B: z.X = m * Cos(a): z.Y = m * Sin(a)
End Sub

' ------- Vector -------

Private Sub vZer(ByRef p As Pt3D)
With p: .X = 0#: .Y = 0#: .z = 0#: End With
End Sub

Private Sub vRev(ByRef p As Pt3D)
With p: .X = -.X: .Y = -.Y: .z = -.z: End With
End Sub

Private Sub vEqu(ByRef p As Pt3D, ByVal ix#, ByVal iy#, ByVal iz#)
With p: .X = ix: .Y = iy: .z = iz: End With
End Sub

Private Sub vMov(ByRef p As Pt3D, ByVal ix#, ByVal iy#, ByVal iz#)
With p: .X = .X + ix: .Y = .Y + iy: .z = .z + iz: End With
End Sub

Private Sub vAdd(ByRef p As Pt3D, ByRef t As Pt3D)
With p: .X = .X + t.X: .Y = .Y + t.Y: .z = .z + t.z: End With
End Sub

Private Sub vSub(ByRef p As Pt3D, ByRef t As Pt3D)
With p: .X = .X - t.X: .Y = .Y - t.Y: .z = .z - t.z: End With
End Sub

Private Sub vSwp(ByRef p As Pt3D, ByRef t As Pt3D)
Dim w As Pt3D
w = p: p = t: t = w
End Sub

Private Sub vMlt(ByRef v As Pt3D, ByVal a#)
v.X = a * v.X: v.Y = a * v.Y: v.z = a * v.z
End Sub

Private Function vMdl(ByRef v As Pt3D) As Double
vMdl = Sqr(v.X ^ 2 + v.Y ^ 2 + v.z ^ 2)
End Function

Private Sub vArg(ByRef v As Pt3D, ByRef w As Pt3D)
Dim S As Cmplx, t As Cmplx, u As Cmplx
Call zEqu(S, w.z, w.X): v.Y = zArg(S)
Call zEqu(S, w.Y, w.z): v.X = zArg(S)
Call zEqu(S, w.X, w.Y): v.z = zArg(S)
End Sub

Private Sub vRot(ByRef v As Pt3D, ByVal xo#, ByVal yo#, ByVal zo#)
Dim u As Cmplx, w As Cmplx
Call zEqu(w, Cos(zo), Sin(zo)): u.X = v.X: u.Y = v.Y: Call zMul(u, w): v.X = u.X: v.Y = u.Y
Call zEqu(w, Cos(xo), Sin(xo)): u.X = v.Y: u.Y = v.z: Call zMul(u, w): v.Y = u.X: v.z = u.Y
Call zEqu(w, Cos(yo), Sin(yo)): u.X = v.z: u.Y = v.X: Call zMul(u, w): v.z = u.X: v.X = u.Y
End Sub

Private Sub vRtt(ByRef v As Pt3D, ByRef r As Pt3D)
Dim u As Cmplx, w As Cmplx
Call zEqu(w, Cos(r.z), Sin(r.z)): u.X = v.X: u.Y = v.Y: Call zMul(u, w): v.X = u.X: v.Y = u.Y
Call zEqu(w, Cos(r.X), Sin(r.X)): u.X = v.Y: u.Y = v.z: Call zMul(u, w): v.Y = u.X: v.z = u.Y
Call zEqu(w, Cos(r.Y), Sin(r.Y)): u.X = v.z: u.Y = v.X: Call zMul(u, w): v.z = u.X: v.X = u.Y
End Sub

Private Sub Form_Terminate()
' 2
' MsgBox "Term"
End Sub

Private Sub Form_Unload(Cancel As Integer)
' 1
MsgBox "Bye!"
End Sub

' //////// MOUSE on Picture1 //////// '

Register to Reply Score 1 for Off Topic
Guru

Join Date: Feb 2012
Location: just died off here
Posts: 518
Good Answers: 1
#42
In reply to #41

Re: Area Between Two Intersecting Circles

10/17/2012 5:00 PM

(sh*t -- i passed a confusing code)

for 3D rotation you want to study

http://en.wikipedia.org/wiki/Rotation_matrix

and/or

http://programming-technique.blogspot.com/2012/03/3d-rotation-algorithm-about-arbitrary.html

(i didnt wanted to use matrices for mine and they're a bit unusual behaviour)

Register to Reply Score 1 for Off Topic
Power-User

Join Date: Nov 2011
Posts: 476
Good Answers: 13
#43
In reply to #42

Re: Area Between Two Intersecting Circles

10/17/2012 5:52 PM

Dude...are you smokin' crack?...wtf ?...seriously ?

Register to Reply
Register to Reply 43 comments
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

Comments rated to be Good Answers:

These comments received enough positive ratings to make them "good answers".

Comments rated to be "almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, rate them!
Copy to Clipboard

Users who posted comments:

bett4haze (3); bioramani (3); ci139 (3); Codemaster (2); devitg (4); jdretired (1); Joshi (2); Lehman57 (1); Mag (1); paresh_career001 (8); Randall (2); snatr (1); TerraMan (5); Tornado (7)

Previous in Forum: Hot Water Heater Again   Next in Forum: Skydiver Felix Baumgartner Breaks Sound Barrier

Advertisement