ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I use x as a variable in a sine function and then graph it (https://www.excelbanter.com/excel-worksheet-functions/199990-how-do-i-use-x-variable-sine-function-then-graph.html)

Confused.Maths.Assignment

How do I use x as a variable in a sine function and then graph it
 
I need to graph the function y=2sin 0.5 PI x
But a) it wont recognise x
b) it wont graph a sine curve
Why? and how do I fix it?

smartin

How do I use x as a variable in a sine function and then graphit
 
Confused.Maths.Assignment wrote:
I need to graph the function y=2sin 0.5 PI x
But a) it wont recognise x
b) it wont graph a sine curve
Why? and how do I fix it?


Are you actually using Excel? Regardless, your example formula needs
help because you have not shown us how to interpret it. Most
programmatic parsers will guess you mean

y = 2 * sin (0.5) * PI * x

, which is pretty silly, really, and would result in a straight line.

I assume you meant,

y = 2 * sin (0.5 * PI * x)

In Excel, you can approach this like so. If you have x values in column
A, place the following formula in column B:

=2*SIN(0.5*PI()*A2)

Create an XY chart on columns A:B. A sine curve is the result.


All times are GMT +1. The time now is 02:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com