Robotics C++ Physics II AP Physics B Electronics Java Astronomy Other Courses Summer Session  

Ellipses

 

 

Code

Exercises

 

 

 

Code

 

Public Class Form1

 

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim G As Graphics

        G = Me.CreateGraphics

        Me.Height = 400

        Me.Width = 400

        Me.BackColor = Color.LightBlue

        Me.ForeColor = Color.Red

        Me.WindowState = FormWindowState.Maximized  'options are normal, minimized, maximized

        Me.Text = "Ellipse"

        Dim pen As New Pen(Color.Black)       

        G.DrawEllipse(pen, 50, 50, 100, 100)   'describe polygon in which the ellipse is drawn  

    End Sub

 

End Class

 

Exercises

Exercise 1

Draw 2 circles that are tangent to each other, one red and the other blue

 

Exercise 2

Draw 30 circles, all same radius, at random locations, and with random colors