The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Line with a definite slope and length
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

jb240

Germany
9 Posts

Posted - 09/19/2016 :  11:00:27 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver.OriginPro2016G and Service Release (Select Help-->About Origin):
Operating System:Win2010

Hello,

Is there a way to draw a line with a definite length and slope? I could only draw them manually and it takes time and not so aaccurate and also not so straight when I draw the diagonal intersecting line.

Thanks so much in advance.

Regards,
JB

Hideo Fujii

USA
1582 Posts

Posted - 09/19/2016 :  4:33:50 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi JB,

Could you please try the following script which creates a line segment object with
specified coordinates of the starting point, slope, and length:
GetN (X1) xx1
     (Y1) yy1
     (Slope) slope1
     (length) length1;
xx2=xx1+length1*cos(atan(slope1));
yy2=yy1+length1*sin(atan(slope1));
draw -l {xx1,yy1,xx2,yy2};
Hope you can get what you wanted by this script.

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 09/19/2016 4:35:34 PM
Go to Top of Page

jb240

Germany
9 Posts

Posted - 09/20/2016 :  06:51:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Hideo,

Thsi works great. Thanks so much.

All the best!
JB

quote:
Originally posted by Hideo Fujii

Hi JB,

Could you please try the following script which creates a line segment object with
specified coordinates of the starting point, slope, and length:
GetN (X1) xx1
     (Y1) yy1
     (Slope) slope1
     (length) length1;
xx2=xx1+length1*cos(atan(slope1));
yy2=yy1+length1*sin(atan(slope1));
draw -l {xx1,yy1,xx2,yy2};
Hope you can get what you wanted by this script.

--Hideo Fujii
OriginLab

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000