[Jprogramming] RE: n00b plotting 2 lines
Alex Rufon
alex_rufon at ist-systems.com
Wed Apr 23 10:15:22 HKT 2008
Oh thanks for the suggestion.
The plan actually is to end up discussing about collision detection
through
1. A system of linear equations
2. Line-Line collision detection
3. Finding the point of intersection using the linear combination method
4. Finding the point of intersection using the substitution method
J is really great for this. :)
-----Original Message-----
From: programming-bounces at jsoftware.com
[mailto:programming-bounces at jsoftware.com] On Behalf Of Tracy Harms
Sent: Monday, April 21, 2008 8:07 PM
To: programming at jsoftware.com
Subject: [Jprogramming] RE: n00b plotting 2 lines
Alex,
Since your topic is slope you may wish to present
something along these lines, too.
plot y1,y2,:y1-y2
=/,= y1-y2
1
>Date: Mon, 21 Apr 2008 21:14:52 +1200
>From: "Sherlock, Ric" <R.G.Sherlock at massey.ac.nz>
>Subject: RE: [Jgeneral] RE: n00b plotting 2 lines
>To: General forum <general at jsoftware.com>
>...
>
>If the x values are the same for all y series then
you
>only need to include it once:
> plot h1;y1,:y2
>
>And for this example you don't need to explicitly
>state x at all because it will default to i.#y
> plot y1,:y2
>
>However the format you have used is more general and
>will work for plots with different x values for each
>y series.
>
>---Original Message-----
>> From: general-bounces at jsoftware.com
[mailto:general-
>> bounces at jsoftware.com] On Behalf Of Alex Rufon
>> Sent: Monday, 21 April 2008 21:07
>> To: General forum
>> Subject: RE: [Jgeneral] RE: n00b plotting 2 lines
>>
>> Hi Ric,
>>
>> Thanks. I got it. I was able to plot 2 parallel
lines with your
>> example.:)
>> h1=. i. 10
>> y1=. 1 + 0.5 * h1 NB. y=0.5X+1
>> y2=. _2 + 0.5 * h1 NB. -3x+6y=-12
>> (h1,:h1);(y1,:y2)
>>
+-------------------+---------------------------------+
>> |0 1 2 3 4 5 6 7 8 9| 1 1.5 2 2.5 3 3.5 4 4.5 5
5.5|
>> |0 1 2 3 4 5 6 7 8 9|_2 _1.5 _1 _0.5 0 0.5 1 1.5 2
2.5|
>>
+-------------------+---------------------------------+
>> plot (h1,:h1);(y1,:y2)
>>
>> r/Alex
>>
--
Tracy B. Harms
A good programming language is a conceptual universe
for thinking about programming.
Alan Perlis
________________________________________________________________________
____________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list