I believe you can easily plot points in 3D space with lines betweens pairs of
points:
require 'plot'
plot (; 2 ; 1) i:10j100
Cheers,
Louis
> On 28 Oct 2017, at 15:12, 'Skip Cave' via Programming
> wrote:
>
> Thanks to Raul & Esa for their very clear instructions
Thanks to Raul & Esa for their very clear instructions and examples for
plotting points in 2D space.
I originally thought that my plot post was overlooked, so I re-posted it
under a more descriptive
title. Then I saw Raul & Esa's posts, so you can ignore that post.
In any case, Raul & Esa's
I had to study the plot docs, and experiment a little. The page
http://code.jsoftware.com/wiki/Plot/Data is probably the most
important to understand.
For your item 1, something like this might work (change the pensize to
change the size of the dots - the default size is too small for a
graph
e.com] On Behalf
Of 'Skip Cave' via Programming
Sent: Saturday, October 28, 2017 6:32 AM
To: programm...@jsoftware.com
Subject: Re: [Jprogramming] Euclidean Distance
As part of my NLP project, I need a way to plot 2D & 3D point cluster plots.
Let's take the example in my previous email:
(0 0, 2
Where do the docs show that you can do this? Hmm...
I suppose one strong hint is at
http://www.jsoftware.com/help/primer/rank_conjunction.htm where it
shows the left argument to the rank conjunction being a verb.
There are also books, like Henry Rich's J for C programmers which
include related
[mailto:programming-boun...@forums.jsoftware.com] On Behalf
Of Gilles Kirouac
Sent: Saturday, October 28, 2017 7:13 AM
To: programm...@jsoftware.com
Subject: Re: [Jprogramming] Euclidean Distance
a=:(0 0, 2 _3 ,: _1 2)
a
0 0
2 _3
_1 2
]b=:1 1,_1 _2,:3 4
1 1
_1 _2
3 4
a(4 :'+/ &.: *:x-y'
ogramming [mailto:programming-boun...@forums.jsoftware.com] On Behalf
Of 'Skip Cave' via Programming
Sent: Saturday, October 28, 2017 5:48 AM
To: programm...@jsoftware.com
Subject: Re: [Jprogramming] Euclidean Distance
Raul,
Yes, rank was the problem. It hit me while I was eating dinner
but your
a=:(0 0, 2 _3 ,: _1 2)
a
0 0
2 _3
_1 2
]b=:1 1,_1 _2,:3 4
1 1
_1 _2
3 4
a(4 :'+/ &.: *:x-y' "1)b NB. Under since Square Root is obverse
(inverse) of Square
1.41421 3.16228 4.47214
a((+/ &.: *:)@: -) "1 b NB. in a tacit way
1.41421 3.16228 4.47214
a([: (+/ &.: *:)
As part of my NLP project, I need a way to plot 2D & 3D point cluster plots.
Let's take the example in my previous email:
(0 0, 2 _3 ,: _1 2) dis 1 1,_1 _2,:3 4
1.41421 3.16228 4.47214
In that distance calculation, their are 6 coordinate pairs, representing 6
points in x & y.
The six
Raul,
Yes, rank was the problem. It hit me while I was eating dinner
but your solution was different than what I expected (they usually are):
Raul:
dis =.4 :'%:+/*:x-y' "1
(0 0, 2 _3 ,: _1 2) dis 1 1,_1 _2,:3 4
1.41421 3.16228 4.47214
0 0 dis 1 1,_1 _2,:3 4
1.41421 2.23607
The items that dis is expecting are rank 1 vectors. So it might make
sense to include a rank 1 specification in its definition:
dis =: 4 :'%:+/*:x-y'"1
Does that work for this example?
0 0 dis 1 1,_1 _2,:3 4
1.41421 2.23607 5
... seems so ...
Thanks,
--
Raul
On Fri, Oct 27, 2017 at
11 matches
Mail list logo