Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Source/func.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9299,25 +9299,25 @@ REAL(EB) FUNCTION CIRCLE_CELL_INTERSECTION_AREA(X0,Y0,RAD,X1,X2,Y1,Y2)
CASE (0)
! First four cases are more than half the cirlce outside the rectangle.
! Can only have one edge where this is the case without having a corner inside. This edge makes a chord.
! Intersection area is the circle area minus the area of the chord.
! Intersection area is the area of the chord.
IF (X2 <= X0 .AND. X2 > X0-RAD) THEN
THETA = 2._EB*ACOS((X0-X2)/RAD)
CIRCLE_CELL_INTERSECTION_AREA = R2*(PI - 0.5_EB*(THETA-SIN(THETA)))
CIRCLE_CELL_INTERSECTION_AREA = 0.5_EB*(THETA-SIN(THETA))
RETURN
ENDIF
IF (Y2 <= Y0 .AND. Y2 > Y0-RAD) THEN
THETA = 2._EB*ACOS((Y0-Y2)/RAD)
CIRCLE_CELL_INTERSECTION_AREA = R2*(PI - 0.5_EB*(THETA-SIN(THETA)))
CIRCLE_CELL_INTERSECTION_AREA = 0.5_EB*(THETA-SIN(THETA))
RETURN
ENDIF
IF (X1 >= X0 .AND. X1 < X0+RAD) THEN
THETA = 2._EB*ACOS((X1-X0)/RAD)
CIRCLE_CELL_INTERSECTION_AREA = R2*(PI - 0.5_EB*(THETA-SIN(THETA)))
CIRCLE_CELL_INTERSECTION_AREA = 0.5_EB*(THETA-SIN(THETA))
RETURN
ENDIF
IF (Y1 >= Y0 .AND. Y1 < Y0+RAD) THEN
THETA = 2._EB*ACOS((X1-X0)/RAD)
CIRCLE_CELL_INTERSECTION_AREA = R2*(PI - 0.5_EB*(THETA-SIN(THETA)))
CIRCLE_CELL_INTERSECTION_AREA = 0.5_EB*(THETA-SIN(THETA))
RETURN
ENDIF
! Remaining cases is where one or more rectangle edges are inside but the corners are outside
Expand Down