Today I want to share with all aspects of Object2D entities.

I’ve had enough too studied to be able to write a viewer for DXF files.

- Object2D degrees and radians are always fully clockwise and counterclockwise not as is normal in trigonometry.
- Unlike the CAD software for the origins are not at the point in the lower left but the point at the top left.

Some important commands:

The bow from two points.

With this memory method I can get an arc angle of 180 degrees.

```
Public Sub DrawArc2points(x1 as double, y1 as double, x2 as double, y2 as double, colore as color)
Dim xDiff As Double
dim yDiff as Double
Dim Radius As Double
Dim Centerx As double
dim centery as double
Dim angolo1 As Double
dim angolo2 as Double
dim a As Integer
CenterX = (x1 + x2) / 2
CenterY = (y1 + y2) / 2
Radius = Sqrt((CenterX - x1) ^ 2 + (CenterY - y1) ^ 2)
xDiff = CenterX - X1
yDiff = y1 - CenterY
If Abs(xDiff) < 0.00000001 Then xDiff = 0
If Abs(yDiff) < 0.00000001 Then yDiff = 0
If xDiff <> 0 Then
angolo1 = Atan(yDiff / xDiff)
If xDiff < 0 Then angolo1 = angolo1 + PI
ElseIf yDiff < 0 Then
angolo1 = 3 * PI / 2 '90
Else
angolo1 = PI / 2 '270
End If
If angolo1 < 0 Then angolo1 = angolo1 + PI * 2
xDiff = CenterX - X2
yDiff = Y2 - CenterY
If Abs(xDiff) < 0.00000001 Then xDiff = 0
If Abs(yDiff) < 0.00000001 Then yDiff = 0
If xDiff <> 0 Then
angolo2 = Atan(yDiff / xDiff)
If xDiff < 0 Then angolo2 = angolo2 + PI
ElseIf yDiff < 0 Then
angolo2 = 3 * PI / 2 '90
Else
angolo2 = PI / 2 '270
End If
If angolo2 < 0 Then angolo2 = angolo2 + PI * 2
angolo2 = atan2(sin(angolo2-angolo1), cos(angolo2-angolo1))
dim angolop, angoloa as double
dim ref as double
if angolo2 > angolo1 then
ref = angolo1
angolo1 = angolo2
angolo2 = ref
end if
angolop = 2*PI - angolo2
'angoloa = angles(0) - angles(1)
'angolop = deg2rad(angolop)
angoloa = deg2rad(180)
' do the results
dim d as new ArcShape
d.Fill = 0
d.Border = 100
d.x = Centerx
d.y = Centery
d.Width = radius * 2
d.Height = Radius * 2
d.StartAngle = angolop
d.ArcAngle = angoloa
primarydraw.Append d
End Sub
```

PLEASE NOTE:

the mathematical function below can be used to calculate the angle of the arc.

We know that it is 180 degrees.

However, all features found for VB.NET, C #, C ++ always report a startAngle and endAngle while xojo and we startAngle How big should our corner.

where angolo1 is STARTANGLE and angolo2 is ENDANGLE.