# Difference between revisions of "Points and Vectors"

From GeoGebra Manual

(→Calculations: starting and terminal points of a vector) |
|||

(14 intermediate revisions by 5 users not shown) | |||

Line 1: | Line 1: | ||

− | <noinclude>{{Manual Page|version= | + | <noinclude>{{Manual Page|version=5.0}}</noinclude>{{objects|geometric}} |

− | {{objects|geometric}} | + | Points and vectors may be entered via [[Input Bar]] in Cartesian or polar coordinates (see [[Numbers and Angles]]). Points can also be created using [[File:Mode point.svg|link=|24px]] [[Point tools]] and vectors can be created using the [[File:Mode vectorfrompoint.svg|link=|24px]] [[Vector from Point Tool]] or the |

− | Points and vectors may be entered via [[Input Bar]] in Cartesian or polar coordinates (see [[Numbers and Angles]]). Points can also be created using [[ | + | [[File:Mode vector.svg|link=|24px]] [[Vector Tool]] and a variety of [[Commands|commands]]. |

− | [[ | ||

{{note|Upper case labels denote points, whereas lower case labels refer to vectors. This convention is not mandatory.}} | {{note|Upper case labels denote points, whereas lower case labels refer to vectors. This convention is not mandatory.}} | ||

− | {{ | + | {{examples|1=<br/> |

− | * To enter a point P or a vector v in Cartesian coordinates you may use <code><nowiki>P = (1, 0) or v = (0, 5)</nowiki></code>. | + | * To enter a point ''P'' or a vector ''v'' in 2D in Cartesian coordinates you may use <code><nowiki>P = (1, 0)</nowiki></code> or <code><nowiki>v = (0, 5)</nowiki></code>. |

− | * | + | * To enter a point ''P'' or a vector ''v'' in 3D in Cartesian coordinates you may use <code><nowiki>P = (1, 0, 2)</nowiki></code> or <code><nowiki>v = (0, 5, -1)</nowiki></code>. |

+ | * To enter a point ''P'' in 2D in polar coordinates, you may use <code><nowiki>P = (1; 0°)</nowiki></code> or <code><nowiki>v = (5; 90°)</nowiki></code>. | ||

+ | * To enter a point ''P'' in 3D in spherical coordinates, enter three coordinates of the type (ρ, θ, φ) like e.g. <code><nowiki>P = (1; 60°; 30°)</nowiki></code>. | ||

+ | * To enter a point in the [[File:Menu view spreadsheet.svg|link=|16px]] [[Spreadsheet View]], name it using its cell address, e.g.: <code><nowiki>A2 = (1, 0)</nowiki></code> | ||

}} | }} | ||

− | {{ | + | {{notes|1= |

− | + | <div> | |

+ | *You need to use a semicolon to separate polar coordinates. If you don’t type the degree symbol, GeoGebra will treat the angle as if entered in radians | ||

+ | *Coordinates of points and vectors can be accessed using [[Predefined Functions and Operators|predefined functions]] <code>x()</code> and <code>y()</code> (and <code>z()</code> for 3D points). | ||

+ | *Polar coordinates of point ''Q'' can be obtained using <code>abs(Q)</code> and <code>arg(Q)</code> (and also <code>alt(Q)</code> for 3D points).</div>}} | ||

+ | |||

+ | {{Examples|1=<div> | ||

+ | *If <code>P=(1,2)</code> is a point and <code>v=(3,4)</code> is a vector, <code>x(P)</code> returns 1 and <code>y(v)</code> returns 4. | ||

+ | *<code>abs(P)</code> returns 2.24 and <code>arg(P)</code> returns 26.57°.</div>}} | ||

+ | |||

+ | |||

+ | |||

+ | ==Calculations== | ||

In GeoGebra, you can also do calculations with points and vectors. | In GeoGebra, you can also do calculations with points and vectors. | ||

{{example|1=<br/> | {{example|1=<br/> | ||

* You can create the midpoint M of two points A and B by entering <code><nowiki>M = (A + B) / 2</nowiki></code> into the Input Bar. | * You can create the midpoint M of two points A and B by entering <code><nowiki>M = (A + B) / 2</nowiki></code> into the Input Bar. | ||

− | * You may calculate the length of a vector v using <code><nowiki>length = sqrt(v * v)</nowiki></code> | + | * You may calculate the ''length'' of a vector ''v'' using <code><nowiki>length = sqrt(v * v)</nowiki></code> or <code><nowiki>length = Length(v)</nowiki></code> |

+ | * You can get the coordinates of the ''starting and terminal point'' of a vector ''v'' using the commands <code><nowiki>Point(v, 0) </nowiki></code> and <code><nowiki>Point(v, 1) </nowiki></code> respectively. | ||

+ | * If ''A = (a, b)'', then <code><nowiki>A + 1</nowiki></code> returns ''(a + 1, b + 1)''. If ''A'' is a [[Complex Numbers|complex number]] ''a+bί'', then <code><nowiki>A+1</nowiki></code> returns ''a + 1 + bί''. | ||

}} | }} | ||

+ | |||

+ | ==Vector Product== | ||

+ | Let ''(a, b)'' and ''(c, d)'' be two points or vectors. Then <code><nowiki>(a, b) ⊗ (c, d)</nowiki></code> returns the z-coordinate of vector product ''(a, b, 0) ⊗ (c, d, 0)'' as single number. | ||

+ | |||

+ | Similar syntax is valid for lists, but the result in such case is a list. | ||

+ | {{example|1=<br/> | ||

+ | * <code><nowiki>{1, 2} ⊗ {4, 5}</nowiki></code> returns ''{0, 0, -3}'' | ||

+ | * <code><nowiki>{1, 2, 3} ⊗ {4, 5, 6}</nowiki></code> returns ''{3, 6, -3}''.}} |

## Latest revision as of 10:43, 1 October 2019

Points and vectors may be entered via Input Bar in Cartesian or polar coordinates (see Numbers and Angles). Points can also be created using Point tools and vectors can be created using the Vector from Point Tool or the
Vector Tool and a variety of commands.

**Note:**Upper case labels denote points, whereas lower case labels refer to vectors. This convention is not mandatory.

**Examples:**

- To enter a point
*P*or a vector*v*in 2D in Cartesian coordinates you may use`P = (1, 0)`

or`v = (0, 5)`

. - To enter a point
*P*or a vector*v*in 3D in Cartesian coordinates you may use`P = (1, 0, 2)`

or`v = (0, 5, -1)`

. - To enter a point
*P*in 2D in polar coordinates, you may use`P = (1; 0°)`

or`v = (5; 90°)`

. - To enter a point
*P*in 3D in spherical coordinates, enter three coordinates of the type (ρ, θ, φ) like e.g.`P = (1; 60°; 30°)`

. - To enter a point in the Spreadsheet View, name it using its cell address, e.g.:
`A2 = (1, 0)`

**Notes:**

- You need to use a semicolon to separate polar coordinates. If you don’t type the degree symbol, GeoGebra will treat the angle as if entered in radians
- Coordinates of points and vectors can be accessed using predefined functions
`x()`

and`y()`

(and`z()`

for 3D points). - Polar coordinates of point
*Q*can be obtained using`abs(Q)`

and`arg(Q)`

(and also`alt(Q)`

for 3D points).

**Examples:**

- If
`P=(1,2)`

is a point and`v=(3,4)`

is a vector,`x(P)`

returns 1 and`y(v)`

returns 4. `abs(P)`

returns 2.24 and`arg(P)`

returns 26.57°.

## Calculations

In GeoGebra, you can also do calculations with points and vectors.

**Example:**

- You can create the midpoint M of two points A and B by entering
`M = (A + B) / 2`

into the Input Bar. - You may calculate the
*length*of a vector*v*using`length = sqrt(v * v)`

or`length = Length(v)`

- You can get the coordinates of the
*starting and terminal point*of a vector*v*using the commands`Point(v, 0)`

and`Point(v, 1)`

respectively. - If
*A = (a, b)*, then`A + 1`

returns*(a + 1, b + 1)*. If*A*is a complex number*a+bί*, then`A+1`

returns*a + 1 + bί*.

## Vector Product

Let *(a, b)* and *(c, d)* be two points or vectors. Then `(a, b) ⊗ (c, d)`

returns the z-coordinate of vector product *(a, b, 0) ⊗ (c, d, 0)* as single number.

Similar syntax is valid for lists, but the result in such case is a list.

**Example:**

`{1, 2} ⊗ {4, 5}`

returns*{0, 0, -3}*`{1, 2, 3} ⊗ {4, 5, 6}`

returns*{3, 6, -3}*.