LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fit a line into a circle based on centrepoint and angle in degrees

Solved!
Go to solution

Hi everyone,

 

I want to fit a line based on two values I got , the centre (x,y) and the angle in degrees from the top of the circle, is this possible? (see the attached picture for more clarification)

0 Kudos
Message 1 of 9
(3,535 Views)
Solution
Accepted by topic author henk_kempen

Sure, just draw a line from (x,y) to (x+radius*cos(angle),y+radius*sin(angle))

 

Angle needs to be in radians (so angle=2*pi*angle in degrees)

 

In fact you probably need to faff about a bit to get the angle as you defined it, so in the top equation I think it would actually be (90-angle) in place of angle. Try it and see what it does.

Message 2 of 9
(3,506 Views)

Thanks, I will give it a try!

 

btw, you said:

... to faff about a bit...

What does that mean (I'm from the netherlands and don't speak english very good:))

 

0 Kudos
Message 3 of 9
(3,497 Views)

doesn't matter, it worked perfectly!! many thanks!

0 Kudos
Message 4 of 9
(3,485 Views)

Angle needs to be in radians ( that didn't work with your way, i did it by divide the degrees with 180 and multiply it with pi)

0 Kudos
Message 5 of 9
(3,448 Views)

There are also "degree to radians" and radians to degrees" functions on the pallette somewhere. I usually locate them with the quickdrop (ctrl+space), they're just already-filled expression nodes, but they save you some time...

 

EDIT: Programming -> Numeric -> Scaling

Best regards,

Jarle Ekanger, MSc, PhD, CLD
Flow Design Bureau AS

- "The resistance of wires in LabVIEW is not dependent on their length."
Message 6 of 9
(3,438 Views)

I don't have it in Labview, probably It's a function in newer labview (I use 2010 fall)

0 Kudos
Message 7 of 9
(3,426 Views)

no radians to degrees.PNG

0 Kudos
Message 9 of 9
(3,280 Views)