<HTML>
<HEAD>
<TITLE>Untitled file 'DVector.html'</TITLE>
<!-- Copyright (c) 1996 by The Geometry Center. All Rights Reserved. -->
</HEAD>
<BODY BGCOLOR="FFFFFF">
<!-- *Navigation-Links -->
<B>Up:</B> <A HREF="source.html"><I>Java Kali Source Code and Documentation</I></A><BR>
<HR>
<p>

<!-- *Begin-Document-Body -->
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Mon Sep 16 15:21:24 CDT 1996 -->
<A NAME="_top_"></A>
<TITLE>
  Class DVector
</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<H1>Class DVector</H1>
<PRE>
<A HREF="http://www.javasoft.com/products/JDK/CurrentRelease/api/java.lang.Object.html#_top_">java.lang.Object</A>
   |
   +----DVector
</PRE>
<HR>
<DL>
  <DT>class <B>DVector</B>
  <DT>extends <A HREF="http://www.javasoft.com/products/JDK/CurrentRelease/api/java.lang.Object.html#_top_">Object</A>
</DL>
A DVector represents a vector in R2; each coordinate
is a double.
<HR>
<A NAME="index"></A>
<H2><IMG SRC="images/constructor-index.gif" WIDTH=275 HEIGHT=38 ALT="Constructor Index"></H2>
<DL>
  <DT><IMG SRC="images/yellow-ball-small.gif" WIDTH=6 HEIGHT=6 ALT=" o ">
	<A HREF="#DVector()"><B>DVector</B></A>()
  <DD>Create a new DVector with unspecified coordinates (actually I
think the coords are initialized to 0, but don't count on this).
  <DT><IMG SRC="images/yellow-ball-small.gif" WIDTH=6 HEIGHT=6 ALT=" o ">
	<A HREF="#DVector(double, double)"><B>DVector</B></A>(double, double)
  <DD>Create a new DVector with given coordinates.
</DL>
<H2><IMG SRC="images/method-index.gif" WIDTH=207 HEIGHT=38 ALT="Method Index"></H2>
<DL>
  <DT><IMG SRC="images/green-ball-small.gif" WIDTH=6 HEIGHT=6 ALT=" o ">
	<A HREF="#array(double, double)"><B>array</B></A>(double, double)
  <DD>Construct an array of DVectors; the array method takes
2,4,6, or 8 doubles, and returns an array of 1,2,3, or
4 DVectors, respectively.
  <DT><IMG SRC="images/green-ball-small.gif" WIDTH=6 HEIGHT=6 ALT=" o ">
	<A HREF="#array(double, double, double, double)"><B>array</B></A>(double, double, double, double)
<DD><DT><IMG SRC="images/green-ball-small.gif" WIDTH=6 HEIGHT=6 ALT=" o ">
	<A HREF="#array(double, double, double, double, double, double)"><B>array</B></A>(double, double, double, double, double, double)
<DD><DT><IMG SRC="images/green-ball-small.gif" WIDTH=6 HEIGHT=6 ALT=" o ">
	<A HREF="#array(double, double, double, double, double, double, double, double)"><B>array</B></A>(double, double, double, double, double, double, double, double)
<DD><DT><IMG SRC="images/green-ball-small.gif" WIDTH=6 HEIGHT=6 ALT=" o ">
	<A HREF="#aString(DVector[])"><B>aString</B></A>(DVector[])
  <DD>Convert an array of DVectors to a string.
  <DT><IMG SRC="images/red-ball-small.gif" WIDTH=6 HEIGHT=6 ALT=" o ">
	<A HREF="#copy()"><B>copy</B></A>()
  <DD>Return a copy of this vector.
  <DT><IMG SRC="images/red-ball-small.gif" WIDTH=6 HEIGHT=6 ALT=" o ">
	<A HREF="#dot(DVector)"><B>dot</B></A>(DVector)
  <DD>Return the dot product of this vector with another one.
  <DT><IMG SRC="images/red-ball-small.gif" WIDTH=6 HEIGHT=6 ALT=" o ">
	<A HREF="#length()"><B>length</B></A>()
  <DD>Return the length (magnitude) of this DVector (sqrt(x^2 + y^2))

  <DT><IMG SRC="images/red-ball-small.gif" WIDTH=6 HEIGHT=6 ALT=" o ">
	<A HREF="#negate()"><B>negate</B></A>()
  <DD>Multiply this vector by -1.
  <DT><IMG SRC="images/red-ball-small.gif" WIDTH=6 HEIGHT=6 ALT=" o ">
	<A HREF="#scale(double)"><B>scale</B></A>(double)
  <DD>Multiply this vector by the scalar s.
  <DT><IMG SRC="images/red-ball-small.gif" WIDTH=6 HEIGHT=6 ALT=" o ">
	<A HREF="#toString()"><B>toString</B></A>()
  <DD>Convert a DVector to a String

</DL>
<A NAME="constructors"></A>
<H2><IMG SRC="images/constructors.gif" WIDTH=231 HEIGHT=38 ALT="Constructors"></H2>
<A NAME="DVector"></A>
<A NAME="DVector(double, double)"><IMG SRC="images/yellow-ball.gif" WIDTH=12 HEIGHT=12 ALT=" o "></A>
<B>DVector</B>
<PRE>
  public DVector(double x,
                 double y)
</PRE>
<DL>
  <DD>Create a new DVector with given coordinates.
</DL>
<A NAME="DVector()"><IMG SRC="images/yellow-ball.gif" WIDTH=12 HEIGHT=12 ALT=" o "></A>
<B>DVector</B>
<PRE>
  public DVector()
</PRE>
<DL>
  <DD>Create a new DVector with unspecified coordinates (actually I
think the coords are initialized to 0, but don't count on this).
</DL>
<A NAME="methods"></A>
<H2><IMG SRC="images/methods.gif" WIDTH=151 HEIGHT=38 ALT="Methods"></H2>
<A NAME="toString()"><IMG SRC="images/red-ball.gif" WIDTH=12 HEIGHT=12 ALT=" o "></A>
<A NAME="toString"><B>toString</B></A>
<PRE>
  public <A HREF="http://www.javasoft.com/products/JDK/CurrentRelease/api/java.lang.String.html#_top_">String</A> toString()
</PRE>
<DL>
  <DD>Convert a DVector to a String
  <DL>
    <DT><B>Overrides:</B>
    <DD><A HREF="http://www.javasoft.com/products/JDK/CurrentRelease/api/java.lang.Object.html#toString()">toString</A> in class <A HREF="http://www.javasoft.com/products/JDK/CurrentRelease/api/java.lang.Object.html">Object</A>
  </DL>
</DL>
<A NAME="length()"><IMG SRC="images/red-ball.gif" WIDTH=12 HEIGHT=12 ALT=" o "></A>
<A NAME="length"><B>length</B></A>
<PRE>
  public double length()
</PRE>
<DL>
  <DD>Return the length (magnitude) of this DVector (sqrt(x^2 + y^2))
</DL>
<A NAME="negate()"><IMG SRC="images/red-ball.gif" WIDTH=12 HEIGHT=12 ALT=" o "></A>
<A NAME="negate"><B>negate</B></A>
<PRE>
  public void negate()
</PRE>
<DL>
  <DD>Multiply this vector by -1.
</DL>
<A NAME="scale(double)"><IMG SRC="images/red-ball.gif" WIDTH=12 HEIGHT=12 ALT=" o "></A>
<A NAME="scale"><B>scale</B></A>
<PRE>
  public void scale(double s)
</PRE>
<DL>
  <DD>Multiply this vector by the scalar s.
</DL>
<A NAME="dot(DVector)"><IMG SRC="images/red-ball.gif" WIDTH=12 HEIGHT=12 ALT=" o "></A>
<A NAME="dot"><B>dot</B></A>
<PRE>
  public double dot(<A HREF="#_top_">DVector</A> v)
</PRE>
<DL>
  <DD>Return the dot product of this vector with another one.
</DL>
<A NAME="copy()"><IMG SRC="images/red-ball.gif" WIDTH=12 HEIGHT=12 ALT=" o "></A>
<A NAME="copy"><B>copy</B></A>
<PRE>
  public <A HREF="#_top_">DVector</A> copy()
</PRE>
<DL>
  <DD>Return a copy of this vector.
</DL>
<A NAME="array(double, double)"><IMG SRC="images/green-ball.gif" WIDTH=12 HEIGHT=12 ALT=" o "></A>
<A NAME="array"><B>array</B></A>
<PRE>
  public static <A HREF="#_top_">DVector</A>[] array(double x0,
                                double y0)
</PRE>
<DL>
  <DD>Construct an array of DVectors; the array method takes
2,4,6, or 8 doubles, and returns an array of 1,2,3, or
4 DVectors, respectively.
</DL>
<A NAME="array(double, double, double, double)"><IMG SRC="images/green-ball.gif" WIDTH=12 HEIGHT=12 ALT=" o "></A>
<A NAME="array"><B>array</B></A>
<PRE>
  public static <A HREF="#_top_">DVector</A>[] array(double x0,
                                double y0,
                                double x1,
                                double y1)
</PRE>
<A NAME="array(double, double, double, double, double, double)"><IMG SRC="images/green-ball.gif" WIDTH=12 HEIGHT=12 ALT=" o "></A>
<A NAME="array"><B>array</B></A>
<PRE>
  public static <A HREF="#_top_">DVector</A>[] array(double x0,
                                double y0,
                                double x1,
                                double y1,
                                double x2,
                                double y2)
</PRE>
<A NAME="array(double, double, double, double, double, double, double, double)"><IMG SRC="images/green-ball.gif" WIDTH=12 HEIGHT=12 ALT=" o "></A>
<A NAME="array"><B>array</B></A>
<PRE>
  public static <A HREF="#_top_">DVector</A>[] array(double x0,
                                double y0,
                                double x1,
                                double y1,
                                double x2,
                                double y2,
                                double x3,
                                double y3)
</PRE>
<A NAME="aString(DVector[])"><IMG SRC="images/green-ball.gif" WIDTH=12 HEIGHT=12 ALT=" o "></A>
<A NAME="aString"><B>aString</B></A>
<PRE>
  public static <A HREF="http://www.javasoft.com/products/JDK/CurrentRelease/api/java.lang.String.html#_top_">String</A> aString(<A HREF="#_top_">DVector</A> v[])
</PRE>
<DL>
  <DD>Convert an array of DVectors to a string.
</DL>
<!-- *End-Document-Body -->
<p>

<!-- *Navigation-Links -->
<HR>
<B>Up:</B> <A HREF="source.html"><I>Java Kali Source Code and Documentation</I></A><BR>

<!-- *GC-Common-Footer -->
<HR>
<NOBR><A HREF="/"><IMG SRC="/pix/home.gif" ALT="[HOME]" ALIGN=MIDDLE></A>
<I>The Geometry Center Home Page</I></NOBR>
<p>
Author: <A HREF="http://www.geom.umn.edu/locate/mbp">Mark Phillips</A><BR>
Comments to:
<A HREF="/admin/mail/webmaster.html">webmaster@geom.umn.edu</A><BR>
Created:  Sep 16 1996 --- 
<!-- hhmts start -->
Last modified: Sep 18 1996
<!-- hhmts end -->
</BODY>
</HTML>
