lawOfCos: Use the law of sines Use the law of cosines to calculate an...

Description Usage Arguments Value References Examples

Description

Given that A, B, and C are the legs of a triangle solve the the opposite angles

Usage

1
lawOfCos(A, B, C)

Arguments

A

numeric Length of side A

B

numeric Length of side B

C

numeric Length of side C

Value

list(a=numeric angle opposite A,b=numeric angle opposite B,c=numeric angle opposite C)

References

http://oakroadsystems.com/twt/solving.htm#eq30

Examples

1
2
3
4
5
6
7
lawOfCos(3,4,5)
lawOfCos(3,3,3)
stimsize.val <- 10 #the stimulus size
dist <- 15 #the distance
visangle(10,15)-lawOfCos(stimsize.val,pythag(stimsize.val/2,dist),pythag(stimsize.val/2,dist))$a
offset <- 5
visangle(10,15,5)-lawOfCos(stimsize.val,pythag(stimsize.val/2+offset,dist),pythag(stimsize.val/2-offset,dist))$a

drknexus/repsych documentation built on May 15, 2019, 2:19 p.m.