cancel
Showing results for
Did you mean:
Level 1
14 5 0 0
Message 1 of 5
728
Flag Post

Solved!

# How do you use the advanced form of LINE_P

HP Recommended
HP PRIME
Microsoft Windows 10 (64-bit)

I'm having trouble understanding how to use the advanced version of LINE_P.

I've tried LINE_P([[0,0],[1/2,sqrt(3)/2]],{0,[0,1],[1,2]},-1) but this returns invalid input. The calculators help function explains each parameter but provides no complete examples and is fairly vague.

Any help here would be apprieciated.

Tags (2)
4 REPLIES 4
Level 6
305 297 32 76
Message 2 of 5
Flag Post
HP Recommended

In your first matrix you define 2 points, so you will never be able to draw more than 1 line.

Your second argument, which is a list of vectors, begins with 0.

Do you mean with this the color black? In that case you should write #0, which is a number in base 16.

The 0 is followed by 2 line definitions: [0,1] and [1,2], but this is not allowed.

You have only 2 points and the first one is referred to with number 1 and the second with number 2.

So your only possible line is [1,2]

Tags (2)
Level 6
305 297 32 76
Message 3 of 5
Flag Post
HP Recommended

This code works for me:

```EXPORT myprogram()
BEGIN
RECT_P();        //clears the screen
LINE_P({{100,30},{250,150}},{#FF,{1,2}},{-1});
FREEZE;
END;```

Some remarks:

The last argument has to be, in absence from a matrix, {-1}

[1,2] did not work for me, I had to write {1,2}.

#FF means color blue, and could also be written as 255.

#0 or 0 is also possible and means color black.

Level 6
252 251 42 77
Message 4 of 5
Flag Post
HP Recommended

Hello,

Note that this form of line only works when the list size are large enough (at least 4 inputs I think from memory). Else the system "thinks" that you are using one of the other forms with 3 points given...

Cyrille

I am an HP Employee
Level 1
14 5 0 0
Message 5 of 5
Flag Post
HP Recommended
I figured out the issue. Lists are indexed from 1, not 0
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation