home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
calcultr
/
vecalc12.arc
/
VECALC.DOC
next >
Wrap
Text File
|
1989-01-16
|
37KB
|
1,280 lines
│
┌────DRCS Bldg.──┐ │
│⌐¬⌐¬⌐¬⌐¬⌐¬⌐¬⌐¬⌐¬│ │
│≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡│ ╔╦╦╬╦╗
│ΓΓΓΓΓΓΓ░░ΓΓΓΓΓΓΓ│ ╟╫╫╫╫╢ │
│ΓΓΓΓΓΓΓΓΓΓΓΓΓΓΓΓ│ ╟╫╫╫╫╢ ┌╨┐
╔╦╦╦╦╦╦╦╦╦╗ │ΓΓΓ░░ΓΓΓΓΓΓ░░ΓΓΓ│ ╟╫╫╫╫╢┌╧═╧┐ _
╠╬╬╬╬╬╬╬╬╬╣ │ΓΓΓΓΓΓΓΓΓΓΓΓΓΓΓΓ│ ╟╫╫╫╫╢│###│ _▒_
╠╬╬╬╬╬╬╬╬╬╣ │ΓΓΓΓ╒ ΓΓΓΓΓΓΓ░░Γ│ ╟╫╫╫╫╢│###│__▒▒▒
╠╬╬╬╬╬╬╬╬╬╣ │ΓΓΓ╓╬╖ΓΓΓΓΓΓΓΓΓΓ│ ╟╫╫╫╫╢│###│░░▒▒▒
╠╬╬╬╬╬╬╬╬╬╣ │ΓΓ╓╩╩╩╖ΓΓΓΓΓΓΓΓΓ│ ╟╫╫╫╫╢│###│░░▒▒▒
╠╬╬╬╬╬╬╬╬╬╣ Detroit Skyline │Γ╓╬╬╬╬╬╖ΓΓΓΓΓΓ█▀█▀█▀█▀█▀█▀█##│░████
╠╬╬╬╬╬╬╬╬╬╣ │Γ║πππππ║ΓΓΓΓΓΓ║■▄■▄■▄■▄■▄■║##│░▌▌▌▌
▒▒ ╠╬╬╬╬╬╬╬╬╬╣ ░▒▒░ │Γ║║║║║║║ΓΓΓΓΓ╓╫╥╥╥╥╥╖■▄■▄■║##│░█▐▐▐
▒▒▒ ╠╬╬╬╓╖╬╬╬╬╣░▒▓▓▒░ ╓╖ ░▄│╓╬╬╬╬╬╬╬ΓΓΓΓΓ╠╬╬╬╬╬╬╣■▄■▄■║##│░▌▌▌▌
▒▓▒▓╠▄░╓║║╖▒▒░║▒▓▓▓▓▒░______╓║║╖____▄░░ ▓░░│║πππππππΓΓ▐██├┼┼┼┼┼┼┤■▄■▄■║##│░█▐▐▐
▓▓▀ ╔║║║║╗ ─── . , ╔║║║║╗ │╬╬╬╬╬╬╬╬ΓΓ▐▐▐├┼┼┼┼┼┼┤■▄■▄■║▓▓▓░▌▌▌▌
▓ ╓║║║║║║║║╖ ─ ╓║║║║║║║║╖ ║ππππππππΓΓ▐▐▐├┼┼┼┼┼┼┤■▄■▄■║▓▓▓░█▐▐▐
╓╔║║║║║║║║║║║║║║╗╗╖╥╓╔╔║║║║║║║║║║║║║║╗ ║║║║║║║║║ΓΓ▐▐▐├┼┼┼┼┼┼┤■▄■▄■║▓▓▓░▌▌▌▌
▀▀▀▀▀▀▀▀║║▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀║║▀▀▀▀▀▀▀▀▀▀▀▀▀▀██▄▄▄▄▄ΓΓ▐▐▐├┼┼┼┼┼┼┤■▄■▄■║▓▓▓▄████
~── ║║ ───── ║║ ── ▀▀▀███▐▐▐├┼┼┼┼┼┼┤▄███████▀▀▀▀
╙╜ . ── ╙╜ ▄▄▄▄▄▄▄▄▄▄▄▄▄ ───
DRCS-VeCalc Version 1.11
Copyright (c) Dan Rubis 1989
Dan Rubis Creative Systems
21719 Harper Ave.
P. O. Box 402
St. Clair Shores, MI 48080-0402
(313) 343-0073 (Voice) CIS 76505,125
DRCS-VeCalc i
TABLE OF CONTENTS
COPYRIGHT NOTICE....................................... ii
DISCLAIMER............................................. ii
LICENSE AGREEMENT..................................... iii
REGISTRATION AND ORDERING INFORMATION.................. vi
ORDER FORM............................................. v
PREFACE TO VERSION 1.11............................... vi
1. INTRODUCTION....................................... 1
1.1 VeCalc Description........................... 1
1.2 System Requirements.......................... 1
1.3 VeCalc Files................................. 1
2. STARTING VECALC.................................... 2
2.1 Starting a VeCalc Session.................... 2
3. VECALC USES........................................ 4
3.1 Three dimensional analysis................... 4
3.2 Graphic uses................................. 10
7. APPENDIX A -Product Support........................ 11
8. APPENDIX B -Acknowledgements....................... 12
DRCS-VeCalc ii
Copyright
DRCS-VeCalc is Copyrighted (c) 1989 by Dan Rubis.
This document is Copyright (c) 1989 by Dan Rubis Creative
Systems.
No part of DRCS-VeCalc or this document may be reproduced,
stored in a retrieval system, or transmitted in any form or
by any means, electronic, mechanical, photocopying,
recording or otherwise except as in accordance with the
Licensing Agreement below, or without the prior written
consent of Dan Rubis C.S.
Disclaimer
DRCS-VeCalc and all accompanying written materials
(including instructions for use) are supplied "AS IS"
without warranty of any kind. Dan Rubis C.S. does not
warrant, guarantee or make any representations regarding the
use, or the results of use, of DRCS-VeCalc or the written
materials in terms of correctness, accuracy, reliability,
currentness, or otherwise. Dan Rubis C.S. will not be
responsible for any direct, indirect, consequential, or
incidental damages (including damages for loss of business
profits, business interruption, loss of business
information, and the like) arising out of the use or
inability to use DRCS-VeCalc even if Dan Rubis C.S. has been
advised of the possibility of such damages.
DRCS-VeCalc iii
License Agreement
DRCS-VeCalc is Copyrighted (c) 1989 by Dan Rubis C.S..
DRCS-VeCalc is not, and has never been public domain or
free software.
DRCS-VeCalc is distributed under the Shareware concept.
Non-registered users of DRCS-VeCalc are granted a limited
license to use DRCS-VeCalc for a trial period in order to
determine whether DRCS-VeCalc suits their needs. Under no
circumstances can an un-registered version of DRCS-VeCalc be
used by a business, organization, or institution of any
kind.
All users are granted a limited license to distribute
shareware versions of DRCS-VeCalc subject to the following
restrictions:
- DRCS-VeCalc is distributed in unmodified form,
along with all program, documentation, and any
other files present in the original package.
- DRCS-VeCalc is not bundled with any other product.
- No distribution fee is charged.
Registered users may receive upgrades from Dan Rubis
C.S. from time to time. Registered copies are NEITHER free
software nor shareware. Users are granted unlimited use of
registered copies of DRCS-VeCalc subject to the following
restrictions:
- DRCS-VeCalc may be installed on more than one
computer at a time, so long as only ONE version
is run at one time.
- Users are not free to copy, modify, or
redistribute registered copies of DRCS-VeCalc IN
ANY WAY whatsoever.
Bulletin Board Services are free to post DRCS-VeCalc for
downloading to prospective users, providing that no fee is
charged for such downloading, aside from possible connect
charges.
Any other groups, companies, or organizations who wish
to distribute DRCS-VeCalc must obtain prior written approval
from Dan Rubis C.S..
DRCS-VeCalc iv
Registration and Ordering Information
Registering DRCS-VeCalc will entitle you to continued use
of DRCS-VeCalc beyond the trial period. Furthermore, it will
entitle you to receive, free of charge, the latest upgrade
to DRCS-VeCalc, as well as technical support.
To register your copy of DRCS-VeCalc, fill out the order
form on the following page, and send it, along with a check
or money order for $10
Dan Rubis Creative Systems
21719 Harper Ave.
P. O. Box 402
St. Clair Shores, MI 48080-0402
21719 Harper Ave.
Distribution is not permitted outside of North America.
Corporate users and other institutions should inquire
at the above address regarding charges for site licensing of
DRCS-VeCalc.
Note that continued use of an unregistered copy is a
violation of the licensing agreement. Support Shareware-
register your copy today!
DRCS-VeCalc v
Order Form
DRCS-VeCalc version 1.11
------------------------------------------------------------
DRCS-VeCalc 1.11 registration ____ @ $10 U.S. ____
NAME_______________________________________________________
Company____________________________________________________
ADDRESS____________________________________________________
____________________________________________________
____________________________________________________
PHONE ____________________ Business ______________________
Where did you obtain DRCS-VeCalc?
______________________________________________________
Comments/Suggestion?
______________________________________________________
______________________________________________________
______________________________________________________
______________________________________________________
DRCS-VeCalc vi
PREFACE TO VERSION 1.11
DRCS-VeCalc was invented out of need for doing a quick vector
calculation while working on engineering and computer graphics
problems. The vectors calculated by DRCS-VeCalc are three
dimensional. To perform a simple cross-product of two vectors,
six multiplications and three subtractions are required. Using
a hand calculator for a calculation like this is tedious and
error prone. This program has been found to be a very handy
tool for small calculations and "what if situations". Take for
instance the angle between two vectors. A two dimension
problem can be easily calculated using trigonometry, but a
three dimensional space problem is a an exercise beyond
comparison.
A memory resident version (TSR) would be even more useful,
because it could be popped-up over any program that needed a
quick vector calculation. A TSR version is being developed and
will be available to registered DRCS-VeCalc users for free when
available.
DRCS-VeCalc 1
1. INTRODUCTION
1.1 DRCS-VeCalc Description
DRCS-VeCalc is a vector calculator. It is like a four
function calculator for vectors. What is a vector? The
use of the word vector in this context is to mean a single
dimension array with three elements of floating point
numbers.
Vectors are used to represent a quantity that has both
magnitude and direction. Two of the most common
applications are in engineering to represent forces and
accelerations, and in geometric modeling and computer
graphics.
1.2 System Requirements
DRCS-VeCalc 1.11 requires an 8080, 80286 or 80386
based computer running IBM or Microsoft DOS 3.x.
A color monitor is desirable.
1.3 DRCS-VeCalc Files
The DRCS-VeCalc distribution diskette contains the
following files:
- VECALC.DOC -program documentation
- VECALC.EXE -executable code for DRCS-VeCalc
- README.1ST -latest changes if any
DRCS-VeCalc 2
2. STARTING VECALC
2.1 Starting the VeCalc Session
Starting DRCS-VeCalc is as simple as typing "VECALC" at
the DOS command prompt. When DRCS-VeCalc is run for the
first time, a file is created to hold the values for
vectors A, B, X, and S. There after, the program reads
this file for default values for the vectors. In effect,
old values are "remembered".
- VEC.DAT -vector data
You will be presented with screen with a window of
vector calculation selections. Choose one by moving the
highlight up or down with the arrow keys. Select function
by pressing the enter key.
At the top of the next the screen the title of the
function you are using will be displayed:
■ Quit
■ Vector addition calculation
■ Vector subtraction calculation
■ Vector dot product calculation
■ Vector cross product calculation
■ Unit vector and magnitude calculation
■ Angle between two vectors in radians calculation
■ Three vector swapping functions
■ Stack vector roll down function
╔════════════════════════════════════╗
║ The Ctrl-Break keyboard function ║
║ is disabled. Select Quit from ║
║ menu to end program. ║
╚════════════════════════════════════╝
and an output window showing the previous values of
vectors A, B, X, and S will be display to the right. To
the left of the ? mark is the OLD value and to the right
will be a blinking cursor waiting for a NEW value or a
"return" to accept the OLD value as the new input.
Some of the functions produce output that is a vector
itself, and some produce a scalar. The vector outputs are
stored in Vector X and scalar values in Stack S[0]. After
each execution of a function that produces a scalar as
output, it will be save in stack position S[0].
Therefore, unless you Roll Down the stack, the old value
will be lost. With successive combinations of Roll Downs of
the Stack and scalar producing vector functions, one can
build up a required vector in the stack for a subsequent
vector function.
DRCS-VeCalc 3
For instance, let us say want to build a vector containing
the magnitudes from three dot-products and then cross that
with the unit vector of a known vector that you may want
to enter in by hand. You would stack your three dot
products in the stack, making sure that you rolled it down
each time and the you would select the cross product of
two vectors, enter your unit vector and you answer would
be calculated and stored in vector X.
A mixed-triple product, which gives you the moment of a
force about an axis can also be calculated using
DRCS-VeCalc. The procedure for that is left to the user.
See the VeCalc uses Section 3.
DRCS-VeCalc 4
3. VECALC USES
ENGINEERING
3.1 3-D Analysis.
General Equations and Principles.
1) Scalar product.
The scalar product of two vectors P and Q is defined as
the product of the magnitudes of P and Q and of the cosine
of the angle φ formed by P an Q (Fig. 3.19). The scalar
Q
│
│
│ ── φ
│ │
└────────────P
Figure 3.19
product of P and Q is denoted by P∙Q. Therefore
P∙Q = PQ cos φ
Note that this expression is not a vector, but a scalar,
which explains the name scalar product; because of the
notation used, P∙Q is also referred to as the dot product of
the vectors P and Q.
Some important applications for the scalar product are
finding the angle between two vectors and projecting a
vector on an axis. In the particular case when the vector
selected along OL is the unit vector i (Fig. 3.23)
y
│ L
│ ∙
│ Q P
│ ∙ ∙
│ ∙ φ ∙
│ ∙ ∙
│ i ∙
│∙∙
O└───────────────────x
∙ Figure 3.23
∙
∙
∙
z
we write
POL = PQ cos φ
or
POL = P ∙ i
DRCS-VeCalc 5
2) Vector product (Moment of a force about a point).
The vector product of two vectors P and Q is defined as
the vector V which satisfies the following conditions:
1. The line of action of V is perpendicular to the
plane containing P and Q (Fig. 3.6).
V = P X Q (where X means cross)
│
│ Q
│ ∙
│ ∙
│ ∙
│ ∙
│∙
∙ Θ
∙
Figure 3.6 ∙
∙
∙
∙
P
2. The magnitude of V is the product of the magnitudes
of P and Q and of the sine of the angle theta formed by
P and Q (the measure of which always be 180 degrees or
less); we thus have
V = PQ sin theta (3.1)
3. The sense of V is such that a man located at the tip
of V will observe as counterclockwise the the rotation
through theta which brings the vector P in line with
the vector Q; note that if P and Q do not have a common
point of application, they should first be redrawn from
the same point. the three vectors P, Q, and V -- taken
in that order--are said to form a right-handed triad.
As stated above, the vector V satisfying these three
conditions (which define it uniquely) is referred to as the
vector product of P and Q; it is represented by the
mathematical expression
V = P X Q
Because of the "X" notation used, the vector product of two
vectors P and Q; it is also referred to as the cross product
of P and Q.
It follows from Eq.(3.1) that, when two vectors P and Q
have either the same direction or opposite directions, their
vector product is zero.
The vector product V can be expressed in the following
form:
|i j k |
V = |Px Py Pz|
|Qx Qy Qz|
where i, j, and k are unit vectors.
DRCS-VeCalc 6
Moment of a Force about a Point. Consider a force F
acting on a rigid body (Fig. 3.12).
Mo
│
│
│ F
│ ∙
│ ∙
│ ∙
│ ∙
│ r ∙ φ
o└─────────+──────────
Figure 3.12 ∙ A
d ∙
∙
∙
The force F is represented by a vector which defines its
magnitude and direction. However, the effect of the force
on the rigid body depends also upon its point of application
A. The position of A may be conveniently defined by the
vector r which joins the fixed reference point o with A;
this vector is known as the position vector of A. The
position vector r and the force F define the plane shown in
Fig. 3.12.
The moment of F about o is defined as the vector
product of r and F:
Mo = r X F
According to the definition of the vector product
given, the moment Mo must be perpendicular to the plane
containing o and F; thus, the line of action of Mo represents
the axis about which the body tends to rotate when attached
at o and subjected to the force F.
The sense of Mo is defined by the sense of the
rotation which would bring the vector r in line with the
vector F; but this rotation is the rotation that F tends to
impart to the body. Thus the sense of the moment Mo
characterizes the sense of the rotation that F tends to
impart to the rigid body; this rotation will be observed as
counterclockwise by an observer located at the tip of Mo.
Another way of stating the relationship existing between the
sense of Mo and the sense of rotation of the rigid body is
furnished by the right-hand rule.
Finally, denoting by φ the angle between the lines of
action of the position vector r and the force F, we find
that the magnitude of the moment of F about o is
Mo = rF sin φ = Fd
where d represents the perpendicular distance from o to the
line of action of F.
DRCS-VeCalc 7
3) Mixed triple product of three vectors.
The mixed triple product of the three vectors S, P, and
Q is
S ∙ (P X Q)
obtained by forming the scalar product of S with the vector
product of P and Q. This expression may be written in a
more compact form if we observe that it represents the
expansion of a determinant:
| Sx Sy Sz |
S ∙ (P X Q) = | Px Py Pz |
| Qx Qy Qz |
P X Q
│ S
│ ∙
│ ∙ Q
│ ∙ ∙
│ ∙ ∙
│ ∙ ∙
│ ∙ ∙
│∙∙
└───────────────────P
Figure 3.24
The mixed triple product is thus equal, in absolute
value, to the volume of the parallelepiped having the
vectors S, P, and Q for sides.
S
∙
∙ Q
∙ ∙
∙ ∙
∙ ∙
∙ ∙
∙∙
────────────────────P
Figure 3.25
Moment of a Force about a Given Axis.
Consider again a force F acting on a rigid body and the
moment Mo of that force about o (Fig. 3.27).
DRCS-VeCalc 8
y L
│ ∙
MO │ ∙
∙ │ ∙ F
∙ │ C ∙
∙ │ ∙ ∙
∙ │ ∙ ∙
∙ │ i ∙
∙ │ ∙ ∙ φ
O└─────r───+─────────────x
Figure 3.27 ∙ A
∙
∙
∙
∙
z
Let OL be an axis through O; we define the moment Mol of F
about OL as the projection OC of the moment Mo on the axis
OL. Denoting by i the unit vector along OL, and recalling
the expressions for obtaining the projection of a vector on
a given axis and for the moment Mo of a force F, we write
Mol = i ∙ (r X F)
which shows that the moment Mol of F about the axis OL is
the scalar obtained by forming the mixed triple product of
i, r, and F. Expressing Mol in the form of a determinant:
| ix iy iz |
Mol = | x y z |
| Fx Fy Fz |
where ix, iy, iz = direction cosines of axis OL
x, y, z = coordinates of point of application of F
Fx, Fy, Fz = components of force F
the moment Mol of F about OL measures the tendency of the
force F to impart to the rigid body a motion of rotation
about the fixed axis OL.
More generally, the moment of a force F applied at A
about axis which does not pass through the origin is
obtained by choosing an arbitrary point B on the axis
(Fig.3.29) and determining the projection on the axis BL of
the moment Mb of F about B.
DRCS-VeCalc 9
L y F
∙│ ∙
│∙ ∙
│ ∙ δ ∙
│ B∙∙∙∙∙∙∙∙∙∙∙∙∙A
│ ∙ ∙
│ ∙ ∙
│ C∙
│ ∙
O└──────────────+─────────────x
Figure 3.29 ∙
∙
∙
∙
∙
z
Mbl = i ∙ Mb = i ∙ (δr X F)
where δr = ra - rb represents the vector joining B and A.
Expressing Mbl in the form of a determinant,:
| ix iy iz |
Mbl = | δx δy δz |
| Fx Fy Fz |
where ix, iy, iz = direction cosines of axis BL
δx = xa -xb, δy = ya - yb, δz = za - zb
Fx, Fy, Fz = components of force F
DRCS-VeCalc 10
3.2 Graphics Uses.
As mentioned before in the previous section, VeCalc can be
used to calculate the angle between two vectors in three
dimensional space. By calculation the sines and cosines
of a desired angle of rotation, like for instance the
rotation of a graphic image on the screen, one can
transform a matrix of image points to be plotted on the
screen. Admittedly, VeCalc cannot make this calculation
by itself. It is a useful device for checking some of
your work as you are developing you graphics plotting
function. A three by three matrix of direction cosines of
the direction vector will be all that is needed to
calculate the need coordinates of the rotated image.
If the is enough interest in DRCS-VeCalc, and its uses in
graphic calculations, another function can be added called
matrix times a vector, which would enable the direct
transformation of a coordinate in rotation, translation,
and shearing. By adding just one more function called
scalar multiplication of a vector, one can zoom
coordinates, and stretch them.
Please let me know if you are interested in this kind of
application. Unless you take time to contact me, even if
it is by a post card, I will not know.
DRCS-VeCalc 11
7. Appendix A - Product Support
If any problems should come up that are not covered in
the manuals, registered users may receive help from
Dan Rubis C.S.'s Technical Support Division. When sending in
a report of a problem, please make sure to include the
following information:
Computer make:_____________________________________________
Computer peripherals:______________________________________
_________________________________________________
Operating System:__________________________________________
Contents of CONFIG.SYS:____________________________________
Nature of problem:_________________________________________
_________________________________________________
_________________________________________________
_________________________________________________
_________________________________________________
Is problem reproducible?:__________________________________
Other programs running:___________________________________
Registered DRCS-VeCalc users who have problems with
DRCS-VeCalc can receive technical help by sending E-mail
concerning the problem to Dan Rubis on CompuServe (user
ID: 76505,125).
Alternatively, you may write to Dan Rubis C.S. at the
following address:
Dan Rubis Creative Systems
ATTN: Technical Support
21719 Harper Ave.
P. O. Box 402
St. Clair Shores, MI 48080-0402
Finally, registered users may phone the following
number:
(313) 343-0073 (Voice)
DRCS-VeCalc 12
8. Appendix B - Acknowledgements
Dan Rubis Creative System would like to thank the
unknown creator of the Detroit Skyline on the cover page of
this manual. Please let me know who you are so I can give
you due credit. Thanks to Randy for editing this manual and
all of the suggestions and comments on version 1.0. Many
of the enhancements seen in version 1.11 were the direct
result of user comments. Please continue to voice and
opinions or suggestions that would increase the usefulness
of this program to you.