strangely since I have uncommented import processing.dxf.*; it simply works. Not sure why but it does the job...

I've solved the problem by doing some preprocessing, where every group code and it's corresponding value are on the same line. The preprocessing also eliminates leading and trailing whitespaces as @UweAllner suggested. The example input file from the question after preprocessing looks like this: 0 SECTION 2 HEADER 9 $ORTHOMODE...

c++,rotation,angle,ellipse,dxf

You are ignoring the translation of the ellipse, that is, that the center may not be placed at (0, 0). If that where the case, your solution would be OK. To undo the effect of the translation, simply substract the coordinates for the center: auto angle = std::atan2(ellipse.my - ellipse.cy,...

You need the solution formula for this system of equations: (x-x1)^2 + (y-y1)^2 = r^2 (x-x2)^2 + (y-y2)^2 = r^2 where (x,y) are the center of the circle, and (x1,y1) and (x2,y2) are points on the circle. Giving these equations to Wolfram Alpha gives these solutions: x = (-sqrt(-(y1-y2)^2 (x1^2-2...

I don't have experience with AutoCAD files and java, but per your comment regarding C#...You can use the AutoCAD .NET API with C# or VB.net. There is also the ObjectARX library for C++. These are shipped with AutoCAD and are typically used for building AutoCAD plugins. If you don't have...

Here is the DXF reference for arcs according to AutoDesk: Group codes Description 100 Subclass marker (AcDbCircle) 39 Thickness (optional; default = 0) 10 Center point (in OCS) DXF: X value; APP: 3D point 20, 30 DXF: Y and Z values of center point (in OCS) 40 Radius 100 Subclass...

More than a viewer you need a parser for the DXF format, i'd check Kebeja as recommended here.