SIN(2) System Calls Manual SIN(2)NAME
sin, cos, tan, asin, acos, atan, atan2 - trigonometric functions
SYNOPSIS
#include <u.h>
#include <libc.h>
double sin(double x)
double cos(double x)
double tan(double x)
double asin(double x)
double acos(double x)
double atan(double x)
double atan2(double y, double x)
DESCRIPTION
Sin, cos and tan return trigonometric functions of radian arguments. The magnitude of the argument should be checked by the caller to make
sure the result is meaningful.
Asin returns the arc sine in the range -n/2 to n/2.
Acos returns the arc cosine in the range 0 to n.
Atan returns the arc tangent in the range -n/2 to n/2.
Atan2 returns the arc tangent of y/x in the range -n to n.
SOURCE
/sys/src/libc/port
SEE ALSO intro(2)BUGS
The value of tan for arguments greater than about 2^-31 is garbage.
SIN(2)
Check Out this Related Man Page
sin(3m)sin(3m)Name
sin, cos, tan, asin, acos, atan, atan2 - trigonometric functions and their inverses
Syntax
#include <math.h>
double sin(x)
double x;
float fsin(x)
float x;
double cos(x)
double x;
float fcos(x)
float x;
double tan(x)
double x;
float ftan(x)
float x;
double asin(x)
double x;
float fasin(x)
float x;
double acos(x)
double x;
float facos(x)
float x;
double atan(x)
double x;
float fatan(x)
float x;
double atan2(y,x)
double y,x;
float fatan2(y,x)
float y,x;
Description
The and functions return trigonometric functions of radian arguments x for double data types.
The and functions return trigonometric functions for float data types.
The and functions return the arc sine in the range -pi/2 to pi/2 for double and float data types, respectively.
The and functions return the arc cosine in the range 0 to pi for double and float data types, respectively.
The and functions return the arc tangent in the range -pi/2 to pi/2 for double and float data types, respectively.
The and functions return the arc tangent of y/x in the range -pi to using the signs of both arguments to determine the quadrant of the
return value for double and float data types, respectively.
Error (due to roundoff)
When P stands for the number stored in the computer in place of pi = 3.14159 26535 89793 23846 26433 ... . and "trig" stands for one of
"sin", "cos" or "tan", then the expression "trig(x)" in a program actually produces an approximation to trig(x*pi/P), and "atrig(x)"
approximates (P/pi)*atrig(x). The approximations are close.
P differs from pi by a fraction of an ulp; the difference is apparent only if the argument x is huge, and even then the difference is
likely to be swamped by the uncertainty in x. Every trigonometric identity that does not involve pi explicitly is satisfied equally well
regardless of whether P = pi. For example, sin(x)**2+cos(x)**2 = 1 and sin(2x) = 2sin(x)cos(x) to within a few ulps regardless of how big
x is. Therefore, the difference between P and pi is unlikely to effect scientific and engineering computations.
Return Values
All the double functions return NaN if NaN is passed in.
If |x| > 1 then (x) and (x) will return the default quiet NaN.
The function defines (0,0) = NaN.
See Alsohypot(3m), math(3m), sqrt(3m)
RISC sin(3m)
Hi
I have about 10 config files belonging to software that runs on SCO UNIX. These files contain, amongst many other things, a path which points to the software locations. We normally have to change them manually every time the software is coppied to a new location and when you gotta do a few... (45 Replies)
Hi! I'm just new here and don't know much about shell scripting. I just want to ask for help in creating a shell script that will parse a string or value of the status in the xml file. Please sample xml file below. Can you please help me create a simple script to get the value of status? Also it... (46 Replies)
Hello everybody! First time posting here:)
Right, I am trying to pass arguments in my shell scripts using $1, $2 and $3 etc using if else statement........
This is my shell script which is based on serching the google website
#!/bin/sh
wget -t1 -E -e robots=off - -awGet.log -T 200 -H... (47 Replies)
Hi All,
Ok, so I'm fairly new to Unix, but would like to think I'm grasping things fairly ok (Well until now ;) ), BUT with this one I'm going in circles ... LOL .. really can't work out why? So sorry for this post if it seems a little "dumb" .. But here goes.
In short I'd like to achieve the... (55 Replies)
Hi
I tried to extract 19 characters (default) enclosed with in tag from a file using cut command. If the characters comprises of double space, the cut command gives the output with a single spacing.
file 1
<name>Kumar Rajasekaran</name>
cut -c7-26 "file1"
the out put i received is ... (48 Replies)
Hi all, I am brand new to these forums and I am a brand new UNIX Administartor. Don't know any scripting yet :wall:, and would like to learn as my boss is slowly letting me understand everything about being a Sys/*Nix Admin. He created this script which I am trying to replicate because I lost it... (54 Replies)
I have the following code and for some reason when I call the program using
/home/tcdata/tatsh/trunk/hstmy/bin/bash/raytrac.bash --cmod=jcdint.cmod
I get
hasArgument =
hasArgument = true
Somehow the array element is returning even though I have not chosen the option.
... (41 Replies)
Hi all,
In the given script code .
I want to pass the maximum value that variable "i" will have in function DivideJobs () to variable $max of function SubmitCondorJob().
Any help?
Thanks
#!/bin/bash ... (55 Replies)
I have a file in unix with sample data as follows :
--------------------------------------------------------------
--------------------------------------------------------------
{30001002|XXparameter|Layout|$
I want this file to be splitted into different files and corresponding to the sample... (54 Replies)
Need assistance on a Perl script.
I have a list of file names in a file and would like to search/grep the same names in the list of files on the ftp server and output to a file. Any help is appreciable
Below is the script that can give me the list of files,size of file, Modified date on the... (56 Replies)
Hi,
I have basic knowledge on unix shell scripting(not an expert).
My requirement is reading the csv file using the schema defined in the configuration file and if the condition is not mached then move the unmatched record to a error file and matched good records into other file.
In brief: ... (43 Replies)
Is there a way to append an existing xlsx worksheet to add data from a text file ?
I have an excel file for which I need to manipulate the first worksheet based on a text file.
I match the text file to the xlsx and write the 'Scores' column in the xlsx sheet and save the workbook.
For those ... (43 Replies)
HI Folks -
I hope all is well! I have a business process where I manage a text file of substitution variables and their values for a target system. After updating, I run a script to push the changes to the target system.
However, I'm trying to develop a method to be able to automatically... (50 Replies)