COSH function
PRO
BASIC
In Jspreadsheet Formulas Pro, the COSH
function is used to calculate the hyperbolic cosine of a number. This is a mathematical operation that is often used in complex calculations, particularly in the fields of engineering and physics. You simply input the value you want to calculate the hyperbolic cosine for, and the COSH
function will give you the result. It's a helpful tool for performing advanced mathematical calculations quickly and accurately.
Documentation
Returns the hyperbolic cosine of a number.
Category
Math and trigonometry
Syntax
COSH(x)
Parameter | Description |
---|---|
x |
The number for which you want to calculate the hyperbolic cosine. |
Behavior
The COSH
function calculates the hyperbolic cosine of a given number. Here are some of the expected behaviors:
- The function takes one argument, which can be a number, a cell reference containing a number, or a mathematical expression that results in a number.
- If the cell reference or expression results in non-numeric content (like text or booleans), the function will return a
#VALUE!
error. - When the function encounters other errors like
#DIV/0!
,#N/A
,#REF!
,#NAME?
, or#NULL!
, it will return the respective error without attempting to compute the hyperbolic cosine.
Common Errors
Error | Description |
---|---|
#VALUE! |
Returned when the argument is non-numeric, missing, or cell is empty |
Other errors (#DIV/0! , #N/A , #REF! , #NAME? , #NULL! ) |
The function returns the respective error if it encounters these while evaluating the argument |
Best practices
- Always ensure that the argument to the
COSH
function is a number, a cell reference containing a number, or a mathematical expression that evaluates to a number to avoid a#VALUE!
error.- Avoid leaving the argument field blank or pointing the function to an empty cell to prevent a
#NUM!
error.- In case you're using a complex mathematical expression as an argument, double-check the expression for any potential errors that might occur during its evaluation.
- Remember that
COSH
function returns hyperbolic cosine, which varies differently from regular cosine. Make sure it suits your mathematical or data analysis needs.
Usage
A few examples using the COSH function.
COSH(0) // Returns 1 – the hyperbolic cosine of 0
COSH(1) // Returns approximately 1.543 – positive input
COSH(-1) // Returns approximately 1.543 – symmetric result for negative input
COSH(PI()) // Returns approximately 11.592 – input as π
Interactive Spreadsheet Demo
<html>
<script src="https://jspreadsheet.com/v11/jspreadsheet.js"></script>
<script src="https://jsuites.net/v5/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v5/jsuites.css" type="text/css" />
<link rel="stylesheet" href="https://jspreadsheet.com/v11/jspreadsheet.css" type="text/css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />
<script src="https://cdn.jsdelivr.net/npm/@jspreadsheet/formula-pro/dist/index.min.js"></script>
<div id="spreadsheet"></div>
<script>
// Set your JSS license key (The following key only works for one day)
jspreadsheet.setLicense('ZGY3ZmYxMTQ1YWQ3YzBiY2JhMjUzMWYyMTEwYjI1NGNiZTkzOTJjZjBjZmQxN2JmZmIxNGUwZmIxMzYyZjYwNTA5ODI4ZTQ1OTJkNWZiNjBmMjI5YTdlYzUwYjg4ODAwMWI3YzEzZTNlYjU5OGQyMWFmZjI0ZWYwZjFjMWUyZmQsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpVM01ETXhORFE0TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2lkMlZpSWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpOQ0lzSW5OamIzQmxJanBiSW5ZM0lpd2lkamdpTENKMk9TSXNJbll4TUNJc0luWXhNU0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklpd2lZMnhwWlc1MElpd2ljMlZ5ZG1WeUlpd2ljMmhoY0dWeklpd2labTl5YldGMElsMHNJbVJsYlc4aU9uUnlkV1Y5');
// Set the extensions
jspreadsheet.setExtensions({ formula });
// Create a new spreadsheet
jspreadsheet(document.getElementById('spreadsheet'), {
worksheets: [{
data: [
[
"Input (x)",
"COSH(x)",
"Description"
],
[
0,
"=COSH(A2)",
"Hyperbolic cosine of 0"
],
[
1,
"=COSH(A3)",
"Hyperbolic cosine of 1"
],
[
-1,
"=COSH(A4)",
"Hyperbolic cosine of -1"
],
[
2,
"=COSH(A5)",
"Hyperbolic cosine of 2"
]
]
}]
});
</script>
</html>
import React, { useRef } from "react";
import { Spreadsheet, Worksheet, jspreadsheet } from "@jspreadsheet/react";
import formula from "@jspreadsheet/formula-pro";
import "jsuites/dist/jsuites.css";
import "jspreadsheet/dist/jspreadsheet.css";
// Set license
jspreadsheet.setLicense('ZGY3ZmYxMTQ1YWQ3YzBiY2JhMjUzMWYyMTEwYjI1NGNiZTkzOTJjZjBjZmQxN2JmZmIxNGUwZmIxMzYyZjYwNTA5ODI4ZTQ1OTJkNWZiNjBmMjI5YTdlYzUwYjg4ODAwMWI3YzEzZTNlYjU5OGQyMWFmZjI0ZWYwZjFjMWUyZmQsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpVM01ETXhORFE0TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2lkMlZpSWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpOQ0lzSW5OamIzQmxJanBiSW5ZM0lpd2lkamdpTENKMk9TSXNJbll4TUNJc0luWXhNU0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklpd2lZMnhwWlc1MElpd2ljMlZ5ZG1WeUlpd2ljMmhoY0dWeklpd2labTl5YldGMElsMHNJbVJsYlc4aU9uUnlkV1Y5');
// Set the extensions
jspreadsheet.setExtensions({ formula });
export default function App() {
// Spreadsheet array of worksheets
const spreadsheet = useRef();
// Worksheet data
const data = [
[
"Input (x)",
"COSH(x)",
"Description"
],
[
0,
"=COSH(A2)",
"Hyperbolic cosine of 0"
],
[
1,
"=COSH(A3)",
"Hyperbolic cosine of 1"
],
[
-1,
"=COSH(A4)",
"Hyperbolic cosine of -1"
],
[
2,
"=COSH(A5)",
"Hyperbolic cosine of 2"
]
];
// Render component
return (
<Spreadsheet ref={spreadsheet}>
<Worksheet data={data} />
</Spreadsheet>
);
}
<template>
<Spreadsheet ref="spreadsheet">
<Worksheet :data="data" />
</Spreadsheet>
</template>
<script>
import { Spreadsheet, Worksheet, jspreadsheet } from "@jspreadsheet/vue";
import "jsuites/dist/jsuites.css";
import "jspreadsheet/dist/jspreadsheet.css";
import formula from "@jspreadsheet/formula-pro";
// Set license
jspreadsheet.setLicense('ZGY3ZmYxMTQ1YWQ3YzBiY2JhMjUzMWYyMTEwYjI1NGNiZTkzOTJjZjBjZmQxN2JmZmIxNGUwZmIxMzYyZjYwNTA5ODI4ZTQ1OTJkNWZiNjBmMjI5YTdlYzUwYjg4ODAwMWI3YzEzZTNlYjU5OGQyMWFmZjI0ZWYwZjFjMWUyZmQsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpVM01ETXhORFE0TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2lkMlZpSWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpOQ0lzSW5OamIzQmxJanBiSW5ZM0lpd2lkamdpTENKMk9TSXNJbll4TUNJc0luWXhNU0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklpd2lZMnhwWlc1MElpd2ljMlZ5ZG1WeUlpd2ljMmhoY0dWeklpd2labTl5YldGMElsMHNJbVJsYlc4aU9uUnlkV1Y5');
// Set the extensions
jspreadsheet.setExtensions({ formula });
export default {
components: {
Spreadsheet,
Worksheet,
},
data() {
// Worksheet data
const data = [
[
"Input (x)",
"COSH(x)",
"Description"
],
[
0,
"=COSH(A2)",
"Hyperbolic cosine of 0"
],
[
1,
"=COSH(A3)",
"Hyperbolic cosine of 1"
],
[
-1,
"=COSH(A4)",
"Hyperbolic cosine of -1"
],
[
2,
"=COSH(A5)",
"Hyperbolic cosine of 2"
]
]
return {
data
};
}
}
</script>
import { Component, ViewChild, ElementRef } from "@angular/core";
import jspreadsheet from "jspreadsheet";
import * as formula from "@jspreadsheet/formula-pro";
// Set your JSS license key (The following key only works for one day)
jspreadsheet.setLicense('ZGY3ZmYxMTQ1YWQ3YzBiY2JhMjUzMWYyMTEwYjI1NGNiZTkzOTJjZjBjZmQxN2JmZmIxNGUwZmIxMzYyZjYwNTA5ODI4ZTQ1OTJkNWZiNjBmMjI5YTdlYzUwYjg4ODAwMWI3YzEzZTNlYjU5OGQyMWFmZjI0ZWYwZjFjMWUyZmQsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpVM01ETXhORFE0TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2lkMlZpSWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpOQ0lzSW5OamIzQmxJanBiSW5ZM0lpd2lkamdpTENKMk9TSXNJbll4TUNJc0luWXhNU0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklpd2lZMnhwWlc1MElpd2ljMlZ5ZG1WeUlpd2ljMmhoY0dWeklpd2labTl5YldGMElsMHNJbVJsYlc4aU9uUnlkV1Y5');
// Set the extensions
jspreadsheet.setExtensions({ formula });
@Component({
standalone: true,
selector: "app-root",
template: `<div #spreadsheet></div>`
})
export class AppComponent {
@ViewChild("spreadsheet") spreadsheet: ElementRef;
// Worksheets
worksheets: jspreadsheet.worksheetInstance[];
// Create a new data grid
ngAfterViewInit() {
// Create spreadsheet
this.worksheets = jspreadsheet(this.spreadsheet.nativeElement, {
worksheets: [{
data: [
[
"Input (x)",
"COSH(x)",
"Description"
],
[
0,
"=COSH(A2)",
"Hyperbolic cosine of 0"
],
[
1,
"=COSH(A3)",
"Hyperbolic cosine of 1"
],
[
-1,
"=COSH(A4)",
"Hyperbolic cosine of -1"
],
[
2,
"=COSH(A5)",
"Hyperbolic cosine of 2"
]
]
}]
});
}
}