Advanced Visualization
Vectors
Visualize vectors and perform vector operations.
Vector A is (3, 4) and vector B is (1, 2). Their sum is (4, 6). The length of A is √(3² + 4²) = 5, a 3-4-5 right triangle.
DGS draws the arrows from the origin unless the input says otherwise, and it reports the vector operation you asked for. Replacing A+B with A−B subtracts the components instead: (3−1, 4−2) = (2, 2).
Equation
A=(3,4); B=(1,2); A+B
Lengths and tangents
Geometry examples state objects and a relationship, then DGS draws the figure and reports the measurement. A distance is the length of the segment between two points. A common tangent is a line that touches two circles, either externally or internally.
The drawing is there so the algebra has a picture. Lengths that come out as perfect squares stay exact. Other lengths keep a radical when the engine can simplify one, plus a decimal. Editing a coordinate or a radius is the fastest way to see which part of the formula changed.
Reading the input
A=(3,4); B=(1,2); A+B— This assignment names a value, a set, or a coordinate that a later line uses.
Other versions of this example
These stay on this page so each version keeps the same explanation. Choose Try example to run a version in its Studio workflow, or copy it into the editable field below.
Vector addition
This assignment names a value, a set, or a coordinate that a later line uses.
A=(3,4); B=(1,2); A+B
Single vector
This is a command. The name selects the routine, and the items inside the parentheses are its arguments.
vector A=(3,4)
Dot product
This is a command. The name selects the routine, and the items inside the parentheses are its arguments.
dot A=(1,0) B=(0,1)
Projection
This is a command. The name selects the routine, and the items inside the parentheses are its arguments.
projection of A=(2,3) onto B=(1,1)
Angle between vectors
This is a command. The name selects the routine, and the items inside the parentheses are its arguments.
angle between A=(1,0) and B=(0,1)
Try a change
- Edit one number in the field, then use Generate Graph. The studio opens on the homepage with the edited text and runs it.
- Use Open in DGS Studio when you want the expression loaded but not run yet.
Generate Graph posts the expression to the studio graph engine and draws the result on the homepage. The editable field is the entire input, including every line.