473,387 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

using math opertion

7
how can i use math operations in C codes;
such as i want to calculate sin-1(sin inverse):
for example
angle= sin-1(b/a);
here angle , a ,b, all are float;

how can i write a C code using this logic;

plz help me......................


meghla
Feb 25 '10 #1
2 1577
meghla
7
i got a solution ;
it is asin();

but i found difficulties in finding value=sin(degree);
for sin(45) value should be 0.707;
but its 0.8509; its why???? how can i fix the problem????
Feb 25 '10 #2
Banfa
9,065 Expert Mod 8TB
That is because the trigonometry functions in the C maths library do not use degrees for the unit of angle. They use radians.

If you use your calculator (or the calculator program on your computer) to calculate sin(45 radians) then you will get the value 0.8509.

The are 2PI radians in a complete circle therefore 2PI radians = 360 degrees therefore

sin(45 degerees) = sin(PI/4 radians) = 0.707

You need to either work in radians or convert your degree values to radians before calling the trig functions.

Incidentally 45 radians = ~ 2578 degrees or just over 7 full rotations.
Feb 25 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Brian Richmond | last post by:
I'm trying to use a regular expression to match a hidden html tag and replace it with the results of a mysql query. The query is based off a part of the hidden tag. For example: The article...
17
by: cwdjrxyz | last post by:
Javascript has a very small math function list. However there is no reason that this list can not be extended greatly. Speed is not an issue, unless you nest complicated calculations several levels...
11
by: srinivas | last post by:
Hi all, I have one requirement.Is there any way to create a line graph using javascript.If it is please send me the sample code.But the thing is it should work in all browsers. Thanks,...
6
by: sales | last post by:
Hello, I am trying to get my website checkout page to rotate / take turns displaying shopping comparison engine surveys rather than display them all 4 at the same time, thus overwhelming &...
21
by: James Black | last post by:
I am curious if there is a benefit to set attributes directly, in my javascript, or to use setAttribute. For example, I have this: var input = document.createElementNS(xhtmlNS, 'input');...
3
by: knightsmastergeneral | last post by:
Hi, I'm currently working on getting junit and junireport to take some java files, convert it to xml and then display error messages / success rates etc in html which is one of the features of...
2
by: phjones | last post by:
Need help programming mortagage calculator for 3 different loans 7 year, 15 year and 30 year. using java array I am a beginner with Java, This is what I have so far. Need to know if I am off the...
3
by: mamta19 | last post by:
Error: opertion is not allowed wirh referencing to closed application
2
by: davidson1 | last post by:
Hai friends..for menu to use in my website..i found in one website....pl look below website.... http://www.dynamicdrive.com/dynamicindex1/omnislide/index.htm i downloaded 2 files.... ...
1
by: swethak | last post by:
hi, i have a code to disply the calendar and add events to that. It works fine.But my requirement is to i have to disply a weekly and daily calendar.Any body plz suggest that what modifications i...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.