Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #4860 > unrolled thread

Re: Column vectors should be interpreted as simple lists where

Started byBob Hanlon <hanlonr@cox.net>
First post2011-09-11 11:31 +0000
Last post2011-09-11 11:31 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: Column vectors should be interpreted as simple lists where Bob Hanlon <hanlonr@cox.net> - 2011-09-11 11:31 +0000

#4860 — Re: Column vectors should be interpreted as simple lists where

FromBob Hanlon <hanlonr@cox.net>
Date2011-09-11 11:31 +0000
SubjectRe: Column vectors should be interpreted as simple lists where
Message-ID<j4i66d$bv5$1@smc.vnet.net>
MF[x_] := Map[Flatten, x]

When using postfix notation you don't need to use a pure function form such as MF[#]&

Graphics[{
  {Directive[Thick, Gray],
   Line[Table[{{x}, {Sin[x]}}, {x, 0, 6.3, 0.1}] // MF]},
  {Directive[Dashed, Blue],
   Line[{{{2}, {0}}, {{2}, {Sin[2]}}, {{0}, {Sin[2]}}} // MF]},
  {Directive[PointSize[0.02], Blue],
   Point[{{2}, {Sin[2]}}] // MF}},
 Axes -> True]

However, you don't need Flatten if you don't insert all of those extraneous brackets.

Graphics[{
  {Directive[Thick, Gray],
   Line[Table[{x, Sin[x]}, {x, 0, 6.3, 0.1}]]},
  {Directive[Dashed, Blue],
   Line[{{2, 0}, {2, Sin[2]}, {0, Sin[2]}}]},
  {Directive[PointSize[0.02], Blue], Point[{2, Sin[2]}]}},
 Axes -> True]

Eliminating other extraneous material

Graphics[{
  {Thick, Gray,
   Line[Table[{x, Sin[x]}, {x, 0, 6.3, 0.1}]]},
  Dashed, Blue,
  Line[{{2, 0}, {2, Sin[2]}, {0, Sin[2]}}],
  PointSize[0.02],
  Point[{2, Sin[2]}]},
 Axes -> True]


Bob Hanlon

---- "Christopher O. Young" <cy56@comcast.net> wrote: 

=============
It's a nuisance not to be able to enter data for points in the most readable
and intuitive form, i.e., as column vectors, without having to Flatten out
each column vector.

The best workaround I could come up with was to use the following to convert
lists of points to lists of lists.

It's good that we don't need to waste space with parentheses, though. We can
just type in the column vectors as column arrays using Control-return. But
it would be even better if there were something close to the regular square
bracket notation, which is the accepted mathematical notation, and also
takes less space-consuming than curved parentheses.

If WRI could also stop insisting that all input is boldface, users could use
the excellent, time-honored, intuitive notation of having bold-face for
vectors and matrices and regular type for scalars.

Would this be so hard to implement? Maybe slightly different square brackets
could be used, accessible via holding down the option key.

It would be also be a huge time-saver if there were a way to get bracket
pairs via holding down the Control-key, say. I.e., Control-( would type a
_pair_ of parentheses, Control-[ would type a pair of square brackets, etc.

There's a picture at http://home.comcast.net/~cy56/ColumnVectors.png and a
notebook at http://home.comcast.net/~cy56/ColumnVectorsAsPoints.nb .

MF[x_] := Map[Flatten, x]

Graphics[
 {
  {Directive[Thick, Gray],
   Line[Table[{
       {x},
       {Sin[x]}
      } , {x, 0, 6.3, 0.1}] // MF[#] &]},
  
  {Directive[Dashed, Blue],
   Line[{{
       {2},
       {0}
      } , {
       {2},
       {Sin[2]}
      } , {
       {0},
       {Sin[2]}
      }} // MF[#] &]},
  
  {Directive[PointSize[0.02], Blue],
   Point[ {
      {2},
      {Sin[2]}
     } ] // MF[#] &}
  },
 Axes -> True
 ]



--

Bob Hanlon

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web