Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Lisp to c#.net

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
sudarsann
692 Views, 2 Replies

Lisp to c#.net

 

Hi,

Can somebody please convert the following LISP command to C#.Net.
(setq A90A(POLAR A90 (DTR 32.0) A81))
I have tried this:  
A90A = new Point3d(A90.X + (A81 * Math.Cos(32)), A90.Y + (A81 * Math.Sin(32)), A90.Z);
I am getting the resultant angle in Autocad as 33.09581, I need to get 32.00000.

 

Regards

Sudarsan

2 REPLIES 2
Message 2 of 3
hgasty1001
in reply to: sudarsann

Hi,

 

Try this little functions:

 

public Point3d Polar(Point3d bpoint, double r, double theta)
{
    return new Point3d(bpoint.X + r * Math.Cos(theta), bpoint.Y + r * Math.Sin(theta), bpoint.Z);
}

 

public double d2r(double degree)
{
    return (Math.PI * degree) / 180;
}

 

So your code will looks like:

 

A90=Polar(A90,A81,d2r(32));

 

Gaston Nunez

Message 3 of 3
sudarsann
in reply to: hgasty1001

Hi Gasty..

That solved the problem.

Thank you very much.

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost