Showing posts with label triangle. Show all posts
Showing posts with label triangle. Show all posts

Sunday, August 29, 2021

Back to School Reference Sheet

 Back to School Reference Sheet


It's near the end of summer, hence for a lot of students the school year is either about to start or just has started.  


Attached is a link to a quick reference that can be helpful in terms of algebra, pre-algebra, geometry, and trigonometry.  Topics include:


* Solving Equations

* Quadratic Equations

* Completing the Square

* Basic Laws of Logarithms

* Basic Trigonometry Identities

* Some Conversions of Length

* Basic Circle and Right Triangle Properties



I hope you find this useful.   

Good luck, good health, and good fortune to all the students in school this year and may you succeed in all of your studies.

Eddie

All original content copyright, © 2011-2021.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 

Sunday, December 22, 2019

TI-84 Plus CE: Drawing an Isosceles Triangle

TI-84 Plus CE:  Drawing an Isosceles Triangle

Introduction



The program ISOTRI draws an isosceles triangle given the following:

The coordinates of the vertex (F,G). 

The length R, which is the length of the line segments from (F,G) to (A,B) and (F,G) to (C,D). 

The tilt angle, T, the tilt of the triangle.  The counterclockwise convention is used. 

The angle, θ,  between the line segments connecting (F,G) to (A,B) and (F,G) to (C,D). 

TI-84 Plus CE Program:  ISOTRI
(Version 5.3 or later required to use the string commands)

Note:  The degree angle inserted in the calculations allows for user to enter angles in degrees, regardless of calculator setting. 

"2019-12-06 EWS"
ClrHome
Disp "ISOC TRIANGLE"
Disp "(F,G):"
Prompt F,G
Input "LENGTH? ",R
Input "TILT?°",T
Input "ANGLE?°", θ
"("+toString(F)+","+toString(G)+")"→Str1
F+R cos(θ°+T°) → A
G+R sin(θ°+T°) → B
"("+toString(A)+","+toString(B)+")"→Str2
F+R cos(T°) → C
G+R sin(T°) → D
√((D-B)²+(C-A)²) → E
"("+toString(C)+","+toString(D)+")"→Str3
ClrHome
Disp "(F,G):"
Pause Str1
Disp "(A,B):"
Pause Str2
Disp "(C,D)"
Pause Str3
Disp "DIST (A,B)-(C,D):"
Pause E
"DRAW TRIANGLE"
ClrDraw
FnOff
BackgroundOn BLACK
Line(F,G,A,B,1,LTGRAY)
Line(F,G,C,D,1,LTGRAY)
Line(A,B,C,D,1,YELLOW)
Pt-On(F,G,2,ORANGE)
Pt-On(A,B,2,LTBLUE)
Pt-On(C,D,2,LTBLUE)
DispGraph

Examples

Example 1:

(F,G):  (1,1)
R = 6
T = 30°
θ = 60°



Example 2:

(F,G):  (-6,0)
R = 8
T = -10°
θ = 70°




Merry Christmas and Happy Holidays,

Eddie

All original content copyright, © 2011-2019.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author


Saturday, April 27, 2019

HP Prime: Drawing 3D Lines and Boxes

HP Prime:  Drawing 3D Lines and Boxes

Introduction

I was sent an email from Carissa.  One of the questions was to explain the 3D features of LINE and TRIANGLE commands.  Confession:  I have never used to the 3D features of LINE and TRIANGLE before, time to learn something new.  Here is what I learned.


The Command LINE

In 3D drawing, you can connect as many points as you want.  In the most simple form, LINE takes three arguments:

*  Point Definition
*  Line Definition
*  Rotation Matrix

Point Definition

You define points of three dimensions (x, y, z) and if you want, a color.  The color attached to the point dominates any portion of the line that is nearest to the point.   The point definition is a nested list.

Syntax:  { {x, y, z, [color]}, {x, y, z, [color]}, {x, y, z, [color]}, ... }

Pay attention to the order you set your points.  Each point will be tied to an index.  For example, the first point in this list will have index 1, the second point in the list will have index 2, and so on.  Knowing the index number will be needed for the Line Definition.

Line Definition

This is where you assign which lines connect to which points.

Syntax:  { {index start, index end, [color], [alpha]}, {index start, index end, [color], [alpha]}, {index start, index end, [color], [alpha]},  ... }

Like the Point Definition, the Line Definition is a nested list.  You can make as many points as you want. 

Color and alpha in the List Definition overrides any color defined in the Point Definition list.

Rotation Matrix

This tells you the command how you want to rotate the matrix with the respect to the x, y, and z axis, respectively.  The acceptable size for the matrix is 2 x 2 (for x and y only), 3 x 3 (x, y, and z axis) and 3 x 4 (I'm not sure what the fourth column is for).  For this blog entry and in practice, I use the 3 x 3 rotation matrix.

In general:

Rx = [ [1, 0, 0],[0 cos a, -sin a],[0, sin a, cos a] ], rotation about the x axis at angle a
Ry = [ [cos b, 0, -sin b], [0, 1, 0], [sin b, 0, cos b ] ], rotation about the y axis at angle b
Rz = [ [cos c, -sin c, 0], [sin c, cos c, 0], [0, 0, 1] ], rotation about the z axis at angle c

Full Rotation matrix: r = Rx * Ry * Rz

You can create a program to calculate rotation matrix or copy the syntax to use in your drawing program, as shown here:

HP Program ROTMATRIX

EXPORT ROTMATRIX(a,b,c)
BEGIN
// rotate x axis
// rotate y axis
// rotate z axis
LOCAL x,y,z,r; 

x:=[[1,0,0],[0,COS(a),−SIN(a)],
[0,SIN(a),COS(a)]];
y:=[[COS(b),0,−SIN(b)],[0,1,0],
[SIN(b),0,COS(b)]];
z:=[[COS(c),−SIN(c),0],
[SIN(c),COS(c),0],[0,0,1]];
r:=x*y*z;

RETURN r;

END;

Drawing the Boxes

HP Prime Program:  DRAWBOX



The program DRAWBOX draws a simple box. 

EXPORT DRAWBOX()
BEGIN
// 3D line demo
// draw still box demo 
// 2019-04-23 EWS

// black background
RECT(0);

// colors - do this first
LOCAL c1:=#FFFF00h; // yellow
LOCAL c2:=#39FF14h; // neon green
LOCAL c3:=#FFFFFFh; // white


// points of the cube
LOCAL p:={{−3,0,0,c1},{0,−2,2,c1},
{3,0,0,c1},{0,2,−2,c2},
{−3,6,0,c1},{0,4,2,c1},
{3,6,0,c1},{0,8,−2,c2}};


// line definitions
// bottom
LOCAL d1:={{1,2},{2,3},
{3,4},{4,1}};
// top
LOCAL d2:={{5,6},{6,7},
{7,8},{8,5}};
// sides, override with white
LOCAL d3:={{1,5,c3},{2,6,c3},
{4,8,c3},{3,7,c3}};

// rotation matrix
LOCAL r:=[[1,0,0],[0,1,0],
[0,0,1]];

LINE(p,d1,r);
LINE(p,d2,r);
LINE(p,d3,r);

WAIT(0);

END;


HP Prime Program: DRAWBOX2



DRAWBOX2 takes three arguments, rotation of the x axis, rotation of the y axis, and rotation of the z axis.  The arguments are entered in degrees, as the calculator is set to Degrees mode in the program.

EXPORT DRAWBOX2(a,b,c)
BEGIN
// 3D line demo
// draw 3D box
// 2019-04-23 EWS
// rotate the cube

// set degrees mode
HAngle:=1;

// rotation calculation
// rotate x axis
// rotate y axis
// rotate z axis
LOCAL x,y,z,r; 

x:=[[1,0,0],[0,COS(a),−SIN(a)],
[0,SIN(a),COS(a)]];
y:=[[COS(b),0,−SIN(b)],[0,1,0],
[SIN(b),0,COS(b)]];
z:=[[COS(c),−SIN(c),0],
[SIN(c),COS(c),0],[0,0,1]];
r:=x*y*z;

// black background
RECT(0);

// colors - do this first
LOCAL c1:=#FFFF00h; // yellow
LOCAL c2:=#39FF14h; // neon green
LOCAL c3:=#FFFFFFh; // white


// points of the cube
LOCAL p:={{−3,0,0,c1},{0,−2,2,c1},
{3,0,0,c1},{0,2,−2,c2},
{−3,6,0,c1},{0,4,2,c1},
{3,6,0,c1},{0,8,−2,c2}};


// line definitions
// bottom
LOCAL d1:={{1,2},{2,3},
{3,4},{4,1}};
// top
LOCAL d2:={{5,6},{6,7},
{7,8},{8,5}};
// sides, override with white
LOCAL d3:={{1,5,c3},{2,6,c3},
{4,8,c3},{3,7,c3}};

// rotation matrix is already
// defined

LINE(p,d1,r);
LINE(p,d2,r);
LINE(p,d3,r);

WAIT(0);

END;

3D Triangles

The format for TRIANGLE is similar except the definition list has three points to make up the triangle instead of two. Format: {x, y, z, [ c ]}

Code:

EXPORT TEST6241()
BEGIN
// test 3D triangle
RECT_P();

//TRIANGLE({0,0,#0h,0},
//{2,2,#0000FFh,39},
//{1,5,#FF0000h,−2});

LOCAL c:=#400080h;
LOCAL p:={{0,0,0},{−10,−8,2},
{−6,4,3},{0,0,0}};
LOCAL d:={{1,2,3,c},{1,2,4,c},
{1,3,4,c},{2,3,4,c}};
local rotmat= [[1, .5, 0], [.5, 1, .5], [0, .5, 1]];   // Initial rotation matrix. No rotation but translate to middle of screen 
TRIANGLE(p,d,rotmat);

WAIT(0);
END;

Hope this helps and all of our drawing capabilities on the HP Prime are expanded.  Carissa, thank you for your email, much appreciated and I learned a great new skill.  All the best!

Eddie

All original content copyright, © 2011-2019.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Saturday, June 3, 2017

HP 20S and HP 21S: Triangle Program

HP 20S and HP 21S:  Triangle Program


Given three Cartesian coordinates, through points (R1, R4), (R2, R5), and (R3, R6), this program calculates:

1. The lengths of each side, represented by R7, R8, and R9.

2. The angle between lines connected by (R1, R4)-(R2, R5) and (R2, R5)-(R3, R6).  The angle is stored in R0.

3. The area of the triangle.  This is the final results shown.



The keystrokes for the HP 20S and HP 21S in this program are the same.  Store the coordinates in variables R1 through R6, then press XEQ A.

HP 20S and HP 21S Program: Triangle Program

STEP
CODE
KEY
01
61, 41, A
LBL A
02
22, 1
RCL 1
03
65
-
04
22, 2
RCL 2
05
31
INPUT
06
22, 4
RCL 4
07
65
-
08
22, 5
RCL 5
09
51, 21
>P
10
51, 31
SWAP
12
26
R/S
13
71
[ C ] Clear
14
22, 2
RCL 2
15
65
-
16
22, 3
RCL 3
17
31
INPUT
18
22, 5
RCL 5
19
65
-
20
22, 6
RCL 6
21
51, 21
>P
22
51, 31
SWAP
23
21, 8
STO 8
24
26
R/S
25
71
[ C ] (Clear)
26
22, 1
RCL 1
27
65
-
28
22, 3
RCL 3
29
31
INPUT
30
22, 4
RCL 4
31
65
-
32
22, 6
RCL 6
33
51, 21
>P
34
51, 31
SWAP
35
21, 9
STO 9
36
26
R/S
37
71
[ C ] Clear
38
22, 8
RCL 8
39
51, 11
x^2
40
75
+
41
22, 9
RCL 9
42
51, 11
x^2
43
65
-
44
22, 7
RCL 7
45
51, 11
x^2
46
74
=
47
45
÷
48
2
2
49
45
÷
50
22, 8
RCL 8
51
45
÷
52
22, 9
RCL 9
53
74
=
54
51, 24
ACOS
55
21, 0
STO 0
56
26
R/S
57
23
SIN
58
55
*
59
22, 7
RCL 7
60
55
*
61
22, 8
RCL 8
62
45
÷
63
2
2
64
74
=
65
61, 26
RTN

Example:
Inputs:
(R1, R4) = (4, 8)
(R2, R5) = (2, 3)
(R3, R6) = (3, 10)

Outputs:
R7 = 5.3852
R8 = 7.0711
R9 = 2.2361
R0 = 34.6952°
Area = 10.8374

Eddie


This blog is property of Edward Shore, 2017

Earth's Radius by Latitude

Earth's Radius by Latitude Introduction: Calculating the Earth’s Radius In quick, general calculations, we assume that the...