webMathematica >

Mathematica Packages and Applications

Loading Packages

<%@ page language="java"  %>
<%@ taglib uri="http://www.wolfram.com/msp" prefix="msp" %>

<html>
<head>
<title>Live 3D Plotting</title>
</head>

<body text="#171717" bgcolor = "#ffffff">
<html>
<head>
<title>ConvexHull Computation</title>
</head>
<body bgcolor="#FFFFFF">
<h1>ConvexHull Computation</h1>
<msp:evaluate>Needs["ComputationalGeometry`"]; </msp:evaluate>

<msp:evaluate>ConvexHull[ {{1,5},{4,1},{10,2},{5,4}}]</msp:evaluate>
</body>
</html>
<msp:evaluate>
Needs["ComputationalGeometry`"];
ComputationalGeometry`ConvexHull[ {{1,5},{4,1},{10,2},{5,4}}]
</msp:evaluate>
BeginPackage[ "Main`",  {"Main`SubUnit`"}]
...
EndPackage[]
BeginPackage[ "Main`SubUnit`"]

MyFunction::usage = "MyFunction is in context Main`SubUnit`"
...
EndPackage[]
In[1]:=
In[2]:=
Out[2]=
   <msp:evaluate>
Needs["Main`"];
Needs["Main`SubUnit`"];</msp:evaluate>

<msp:evaluate>
MyFunction[ arguments]</msp:evaluate>
    <msp:evaluate> 
Needs["Main`"];
Needs["Main`SubUnit`"];</msp:evaluate>

<msp:evaluate>
Context[ MyFunction]</msp:evaluate>
    <msp:evaluate> 
Needs["Graphics`Master`"];</msp:evaluate>

<msp:evaluate>
color = Graphics`Color`Red </msp:evaluate>

Writing Packages

Installing Packages

webMathematica Applications

$BaseDirectory

$UserBaseDirectory

The Script Directory

<msp:evaluate>
Block[{$Path=Append[$Path, MSPPageDirectory[]]},
Needs["MyPackage`"];
Get["Data.m"];
]
</msp:evaluate>

$TopDirectory

Absolute Filename

    <msp:evaluate>Get[ "d:\\My Work\\LastOneThatWorked\\MyFile.m"]</msp:evaluate>