Projections on Mathematica

Projections on Mathematica - (* Content-type:...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
(* Content-type: application/mathematica *) ( (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) ( (* CreatedBy='Mathematica 6.0' *) ( (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 44585, 941] NotebookOptionsPosition[ 42909, 881] NotebookOutlinePosition[ 43249, 896] CellTagsIndexPosition[ 43206, 893] WindowFrame->Normal ContainsDynamic->False*) C (* Beginning of Notebook Content *) Notebook[{ Cell[BoxData[{ StyleBox[ RowBox[{ RowBox[{"Vector", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"ip", ":", RowBox[{"{", RowBox[{"_", ",", "_"}], "}"}]}], ",", RowBox[{"vec", ":", RowBox[{"{", RowBox[{"_", ",", "_"}], "}"}]}]}], "}"}], ",", "styles___"}], "]"}], ":=", RowBox[{"Graphics", "[", RowBox[{"{", RowBox[{ RowBox[{"Arrowheads", "[", "Medium", "]"}], ",", " ", RowBox[{"Thickness", "[", ".005", "]"}], ",", "styles", ",", "\[IndentingNewLine]", RowBox[{"Arrow", "[", RowBox[{"{", RowBox[{"ip", ",", RowBox[{"ip", "+", "vec"}]}], "}"}], "]"}]}], "}"}], "]"}]}], FontSize->18], "\[IndentingNewLine]", StyleBox[ RowBox[{ RowBox[{"Vector", "[", RowBox[{ RowBox[{"posvec", ":", RowBox[{"{", RowBox[{"_", ",", "_"}], "}"}]}], ",", "styles___"}], "]"}], ":=", RowBox[{"Vector", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", "posvec"}], "}"}], ",",
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
"styles"}], "]"}]}], FontSize->18]}], "Input"], Cell[BoxData[ StyleBox[ RowBox[{ RowBox[{ "Import", "[", "\"\<http://www.math.armstrong.edu/Vectors.m\>\"", "]"}], "\n"}], FontSize->24]], "Input"], Cell[BoxData[ RowBox[{ RowBox[{"comp", "[", RowBox[{"b_", ",", "a_"}], "]"}], ":=", RowBox[{ RowBox[{"a", ".", "b"}], "/", SqrtBox[ RowBox[{"a", ".", "a"}]]}]}]], "Input", CellChangeTimes->{{3.433471455845414*^9, 3.433471504673414*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"proj", "[", RowBox[{"b_", ",", "a_"}], "]"}], ":=", RowBox[{ RowBox[{"comp", "[", RowBox[{"b", ",", "a"}], "]"}], RowBox[{"a", "/", SqrtBox[ RowBox[{"a", ".", "a"}]]}]}]}]], "Input", CellChangeTimes->{{3.433471516233014*^9, 3.433471538260214*^9}, { 3.4334717601702137`*^9, 3.4334717792022142`*^9}}], Cell[CellGroupData[{ C Cell[BoxData[{ RowBox[{ RowBox[{"a", "=", RowBox[{"{", RowBox[{"5", ",", "1"}], "}"}]}], ";", RowBox[{"b", "=", RowBox[{"{", RowBox[{"2", ",", "2"}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"comp", "[", RowBox[{"b", ",", "a"}], "]"}]}], "Input", CellChangeTimes->{{3.433471828326614*^9, 3.433471864955414*^9}, { 3.433472725311014*^9, 3.433472732065814*^9}}], Cell[BoxData[ RowBox[{"6", " ", SqrtBox[ FractionBox["2", "13"]]}]], "Output", CellChangeTimes->{3.433471866031814*^9, 3.433472734359014*^9}] }, Open ]], } Cell[CellGroupData[{ C Cell[BoxData[
Background image of page 2
RowBox[{"proj", "[", RowBox[{"b", ",", "a"}], "]"}]], "Input", CellChangeTimes->{{3.433471891662614*^9, 3.433471899447014*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ FractionBox["30", "13"], ",", FractionBox["6", "13"]}], "}"}]], "Output", CellChangeTimes->{3.433471901381414*^9, 3.433472738243414*^9}]
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/24/2011 for the course M 408d taught by Professor Sadler during the Spring '07 term at University of Texas at Austin.

Page1 / 17

Projections on Mathematica - (* Content-type:...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online