Graphing a Cosine Wave with Google Sheets

Graphing a Cosine Wave with Google Sheets
Google Sheets can be used by students to graph cosine waves. A Cosine wave is a mathematical curve that describes a smooth repetitive oscillation. A cosine wave is identical to a sine wave, except that each point on the cosine wave occurs exactly 1/4 cycle earlier than the corresponding sine wave.

Log into your Google account, go to Google Drive, and create a new Google Sheet.

DraggedImage.d63d89bbc2024e948b0ac1470efd0060.png

 

DraggedImage.6fa04a1a426048ef9e98e5db397f4144.png

Click on the untitled spreadsheet name and rename it cosine wave.

DraggedImage.8f62bb2fca4e49ad9741678ed8ccef91.png

We will create a list of degrees in our first column to set the initial values. We will then convert those values to radians. Angles need to be converted to radians because Google sheets uses radians in the cosine function. Click on cell A1 and type “x in degrees” for the heading. Press the enter key to go to the cell below or click on the cell below.

DraggedImage.283c7d84334b4b35af3c552dd70c259b.png

Enter a zero in cell A2 and press the enter key to go down to the next cell. Enter the values 30 and 60 respectively in the following cells using the same process.

DraggedImage.a9d39af4afe74c818ef1762168825c9b.png

We need to provide more values for our wave, but we don’t need to enter them ourselves. Google Sheets can help us create the remaining values. Highlight the first three values.

DraggedImage.2c94cf298ca64cda9307e9dc073d887e.png

Click on the blue square that appears in the lower right corner of the selection. The mouse cursor will change to a plus sign when it can be selected. Click and drag the square box down the column.

DraggedImage.b12193ba54124ecea0d8205edc4b27b1.png

Drag down to the 20th row and release.

DraggedImage.0aca491692dc4e41821c215099e9b686.png

Google Sheets will use the first three values as a pattern for creating the other values.

DraggedImage.7644a39b78bc478ab1658e0e016464df.png

Click on cell B1 and type “x in radians” for the heading.

DraggedImage.04c461ec7b804acda1db24d4134b3b2c.png

Google Sheets has a function that calculates the radian of a degree. Click on the cell below the heading we just typed and press the equal sign “=“ on the keyboard. An equal sign is used to tell Sheets we are about to perform a mathematical operation or use a function.

DraggedImage.f2000e0b6dae4a498a43476e87313381.png

Type the word radians after the equal sign.

We need to either enter the value of the degree to convert to a radian or tell the function where the value can be found. In this example, the value for the radian function can be found in the adjacent column. The cell in the adjacent column is referred to as a reference cell. Reference cells are valuable because we can change the values in these cells and the value for the radians is automatically recalculated. If we didn’t use a reference cell then we would need to change each value in each radian function down the column.

DraggedImage.32cfc740bc994d73824c13e69d28dd6a.png

To reference the adjacent cell, type an open parenthesis after the radians function. Sheets tries to help out by providing an example of what we can place after the open parenthesis.

DraggedImage.340d7684bbee44ccb6ab80a1a2272706.png

Type the reference cell coordinates. In this example, that would be A2. The value A2 changes to an orange color. This is visual feedback for us so we know that Sheets sees the value as a reference to a cell.

DraggedImage.1565966e1b5d4c579bb054b01fdc643f.png

Type a closing parenthesis to finish entering the value for the function. Press the return key to go down to the next cell in the column.

DraggedImage.7e044501345d4591adbf8a80e0137a8a.png

We could manually repeat this process for all the other cells, but we can use the same blue box we used earlier to generate the list of degrees. Select the cell where we just used the radians function. Click and drag the corner square down to row 20.

DraggedImage.1ea2c566f027447eb1d406b012413f5a.png

The radians function will use the values in the reference cells on the left calculate the radian for each degree.

DraggedImage.0e4709079f434c82a75e7320246dcde0.png

Click on cell C1 and type “cosine” for the heading.

DraggedImage.81e61b5a4299441eb721ce57ce56c910.png

Sheets has a function that calculates the cosine using the radians value. Type and equal sign to begin the function and type cos after the equal sign.

DraggedImage.405ed90d797b43e1babf539d73f19065.png

Type an open parenthesis and provide the reference cell for the radians value. In this example, that would be B2.

DraggedImage.08baea9767c24a65a266cfd70ca254ac.png

Close the parenthesis and press the return key on your keyboard.

DraggedImage.3a59731fc9ec4de9ad2c6be950792e1b.png

We can duplicate this function for the other values using the same process we used earlier. Click and drag the blue box down the column to row 20.

DraggedImage.ec9943c711774b9497cfb344624d2a67.png

We have the values needed to create the wave graph. We need to select the values for degrees and the values for cosine. Click once on the column heading for degrees. This is the Sheet heading not the heading we entered in cell A1. Click on the “A”.

DraggedImage.f0236b5f6b204dcfb22c1aa3a09be178.png

We need to select the values in the cosine column without selecting the radian values. We can use a shortcut key to bypass the column in the middle. Press and hold the control key on Windows or Chromebook. Hold the Command key on Mac. While holding one of these keys, click on column “C”. The two columns should be selected.

DraggedImage.a71b84bc1f0c4da78d07e56464da49ef.png

Click on the chart button in the button bar.

DraggedImage.c35f66c40b67410fa73cd8d8ccbcec3c.png

Click on the Chart Types tab in the Chart editor box that opens.

DraggedImage.4feb634404544926823af3f026bf112a.png

Click on the smooth line graph option.

DraggedImage.00c5b2a9b4234b8484ce6e9fb830da3e.png

Click on the option to use Column A as labels.

DraggedImage.f112cb34a69c4d9bb60889ff4ac2a48f.png

Click on the Customization tab.

DraggedImage.4a6b8444c4014fbca876301220062194.png

Change the chart title to cosine wave.

DraggedImage.823c4e52a7124ff286c8289bfb401449.png

Click on the legend option and select none.

DraggedImage.d33f194178d7482db05b0644db2bc83f.png

Click on the Maximize option in the Feature section.

DraggedImage.a4ee56029fda4aa0b7926ea55f051982.png

Click on the Point Shape option and select a shape option to identify each of the cosine values along the curve.

DraggedImage.561baddb087643398090b85bf3c84523.png

Click on the color option to select a different color for the point shapes and line.

DraggedImage.4d1061b39a9b45888467eafaa52cd865.png

Click on the Data labels value option if you want to display the value of each cosine point along the curve.

DraggedImage.89300d72f7824cc6b782cb4f513ca2ca.png

Click the insert button to place the graph onto the spreadsheet.

DraggedImage.92020482d68c43218d9d2e0ff0ddd2f7.png

The graph might be placed above one of the columns of data. The graph can be moved by clicking and dragging the graph to the side.

DraggedImage.56735d9d1a2b4d60ba00dd91b3dc5b8e.png

The corner handles of the graph can be used to resize the graph.

DraggedImage.d14c60b5e5164350a8ec5cbca1b02bf9.png

To edit the chart, click on the pull down triangle in the top right hand corner of the graph. This triangle and the other tools appear when the chart is selected.

Changing the degrees value in column A will automatically update the radians and the values associated in the grah.

Posted in Google Sheets.