Are the Lines Parallel?

Manipulate[
Graphics[Flatten[{Thickness[thickness],
Table[Line[{{6-n,0},{0,6-n}}],{n,number/2}],
Table[Line[{{n,5},{5,n}}],{n,number/2}],
Thickness[thickness2],
If[thickness2≠0,Table[
crossline[n-m,n+m,angle],
{n,3-number/4,2.5+number/4,0.5},
{m,-5,5,gap}],{}]}
],PlotRange->{{0,5},{0,5}}],
Style["main lines",FontWeight->"Bold"],
{{thickness,0.006,"thickness"},0.001,0.02},
{{number,10,"number"},2,10,2},
Style["cross lines",FontWeight->"Bold"],
{angle,0,π/2},
{{thickness2,0.006,"thickness"},0,0.02},
{{gap,0.5,"separation"},0.25,1},
Initialization:>(crossline[n_,m_,angle_]:=If[EvenQ[Round[n+m]],
Line[{{n,m}-{Cos[angle],Sin[angle]}/3,{n,m}+{Cos[angle],Sin[angle]}/3}],
Line[{{n,m}-{Cos[angle+π/2],Sin[angle+π/2]}/3,{n,m}+{Cos[angle+π/2],Sin[angle+π/2]}/3}]])]

CAPTION

Are the long lines parallel? Adjust the short lines to see.

THIS NOTEBOOK IS THE SOURCE CODE FROM

"Are the Lines Parallel?" from the Wolfram Demonstrations Project
 http://demonstrations.wolfram.com/AreTheLinesParallel/

Contributed by: Jon McLoone

A full-function Wolfram Mathematica system (Version 6 or higher) is required to edit this notebook.
GET WOLFRAM MATHEMATICA »

© Wolfram Demonstrations Project & Contributors   |   Terms of Use   |   Make a new version of this Demonstration »