J

From MathWeb

Jump to: navigation, search

J is a functional programming language. It is an array-oriented, fast, interpreted tool-of-thought with an extremely regular and well thought-out grammar. J is particularly suitable for mathematical exploration as it is a regularized, executable, mathematical notation. The language also excels as a tool for rapidly solving a wide variety of problems in data-processing and analysis.

Contents

A Sample of J Code

A simple example of J's terseness and power is shown by this plot which is generated by the following two lines of code.

  load 'plot'
  'surface' plot +/~1 o. i:3j99

Brief Explanation of this Code

The first line loads a package of plotting functions into their own namespaces. The second line uses the function "plot" with a left argument specifying that this is a "surface" (or 3-D) plot and a right argument specifying a simple J expression which generates a table of numbers.

Breaking down the expression

  +/~ 1 o. i:3j99

into three components, first consider "+/~" which adds (+) arrays orthogonally (/), using its right argument also as its left argument(~). This right argument is generated by the expression "1 o.", which is the first "circle" function (sine), applied to the vector generated by "i:3j99". This uses the function "i:" with the complex argument "3j99" to give (99+1) evenly-spaced numbers from negative three to positive three.

Essentially this is a surface created by adding all points in a sine wave segment to each other.

Resources

Introductions

Examples of Graphics

Retrieved from "http://mathweb.org/wiki/J"
Personal tools
MathWeb
Structures