# drawing an elliptical figure

## drawing an elliptical figure

hi,
I have written a code for the circular figures within the circle . But I am unable to draw the elliptical figure within the circle .Please help me in doing so...

I am attaching these files for your reference

DO ii = 1,StatorCore.n_axial_hole_sets !-- Calc hole profile for each type/size of hole CALL Hole_Profile_Calc(dtheta_hole,hole_profile, & StatorCore.AxialHole(ii),n_slice_net) end do

SUBROUTINE MCM_DISPLAY_STATOR_AXIAL_HOLES

USE DFLIB
USE SimulationSettingsModule
USE DefineGlobalVarsModule
IMPLICIT NONE

!-------------------------------------------------------------------------------
! Local Variables
!-------------------------------------------------------------------------------
INTEGER j
INTEGER k
INTEGER(2) status
REAL theta

REAL(8) wx1,wy1
REAL(8) wx2,wy2
REAL(8) wx00,wy00
REAL(8) wx0,wy0
REAL(8) WX3,WX4,WY3,WY4
!-----------------------------------------------------------------------
! Set & Display Stator Axial Circular Holes and Bolts
!-----------------------------------------------------------------------
!status = SETCOLOR(4) ! Red

DO k = 1,StatorCore.n_axial_hole_sets

! Coordinates of first stator hole of type k
wy00 = 0.0

DO j = 1,StatorCore.AxialHole(k).n_holes
! Rotate center coordinate for each stator hole
theta = StatorCore.AxialHole(k).theta_to_center &
+ (j-1)*PI2/StatorCore.AxialHole(k).n_holes

wx0 = wx00*cos(theta) - wy00*sin(theta)
wy0 = wx00*sin(theta) + wy00*cos(theta)

! Calculate new coordinates for each stator hole
wx1 = wx0 - 0.5*StatorCore.AxialHole(k).OD
wy1 = wy0 + 0.5*StatorCore.AxialHole(k).OD
wx2 = wx0 + 0.5*StatorCore.AxialHole(k).OD
wy2 = wy0 - 0.5*StatorCore.AxialHole(k).OD

! Display each rotated hole
status = ellipse_W(\$GBORDER, wx1,wy1,wx2,wy2)

! Display bolt (if present)
!IF (StatorCore.AxialHole(k).Bolt.present) THEN

! Calculate new coordinates for each stator bolt
! wx1 = wx0 - 0.5*StatorCore.AxialHole(k).Bolt.OD
! wy1 = wy0 + 0.5*StatorCore.AxialHole(k).Bolt.OD
! wx2 = wx0 + 0.5*StatorCore.AxialHole(k).Bolt.OD
! wy2 = wy0 - 0.5*StatorCore.AxialHole(k).Bolt.OD

! Display each rotated hole
! status = ELLIPSE_W(\$GBORDER, wx1,wy1,wx2,wy2)

! ENDIF

ENDDO
ENDDO

!-----------------------------------------------------------------------
END SUBROUTINE MCM_DISPLAY_STATOR_AXIAL_HOLES
!-----------------------------------------------------------------------

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.