Microsoft Small Basic

Program Listing:
Embed this in your website
' Heart Mark and its area by NaochanON 2013/02/04

GraphicsWindow.PenColor="red"
GraphicsWindow.PenWidth=2
L=30
X0=200
Y0=100
ds=0.05
dL=0.05
For i=0 To (360-ds) Step ds
  X1=X0+L*math.Sin(Math.GetRadians(i))
  Y1=Y0-L*math.Cos(Math.GetRadians(i))
  GraphicsWindow.DrawLine(X0,Y0,X1,Y1)
  s=s+L*L*Math.GetRadians(ds)/2         ' area
  If  i<180 Then
    L=L+dL
  Else
    L=L-dL
  EndIf
EndFor
GraphicsWindow.FontSize=20
GraphicsWindow.DrawText(120,10,"Area is ... "+math.Floor(S*10)/10)



Copyright (c) Microsoft Corporation. All rights reserved.