Products

IMCOT function

PRO BASIC

The IMCOT function in Jspreadsheet Formulas Pro is used to calculate the cotangent of a complex number. This complex number should be in the format of x + yi or x + yj. The function aids in performing mathematical computations involving complex numbers, specifically those requiring the cotangent value. This can be particularly useful in various fields such as engineering, physics, or any discipline that involves complex number calculations.

Documentation

Returns the cotangent of a complex number in x + yi or x + yj text format.

Category

Engineering

Syntax

IMCOT(inumber)

Parameter Description
inumber The complex number for which you want to calculate the cotangent.

Behavior

The IMCOT function is used to return the cotangent of a complex number. This function takes one argument, which is the complex number in the form x+yi or x+yj.

  • If the cell is empty or contains text, the IMCOT function will return a #VALUE! error.
  • The IMCOT function does not accept boolean values. If the input is a boolean value, it will return a #VALUE! error.
  • If the input is a numerical value, it will be considered as a complex number with an imaginary part of 0.
  • If the input is a valid complex number, the function will return the cotangent of that complex number.
  • If the function encounters an invalid argument or any error in the calculation, it will return a #NUM! error.

Common Errors

Error Description
#VALUE! This error is returned when the input is not recognized as a valid complex number. This can occur if the cell is empty, contains text, or a boolean value.
#NUM! This error is returned when the calculation encounters an error or the argument is not acceptable. For example, if the denominator in the cotangent calculation is zero.

Best practices

  • Always ensure that the input to the IMCOT function is a valid complex number. Invalid inputs can lead to errors.
  • Handle the errors properly using error checking functions like ISERROR or IFERROR to avoid getting #VALUE! or #NUM! errors.
  • Avoid passing boolean values or empty cells to the IMCOT function to prevent #VALUE! errors.
  • It is always good practice to understand the mathematical implications of the cotangent function before using the IMCOT function, particularly in the context of complex numbers.

Usage

A few examples using the IMCOT function.

IMCOT("3+4i") returns approximately -0.000187587737983659-1.00064439247156i
IMCOT(1) returns approximately 0.6421  
IMCOT("0+1i") returns approximately -1.31303528549933i
IMCOT("2+3j") returns approximately -0.00373971037633696-0.996757796569358j

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('M2M5N2RhZmYxMjMwY2Y4NDliNTBjNTk3YWRlYTJiMTJhN2FiYWYzODRkM2ZiOGYwOTU4N2NhNDBkZGM1NzlkZTI0ZGYxMTM4ODdhYjY2YWFhYjhhNjhiODAyZDQzMWNlYjAyZmVkZmQ4ZjM3MTA3NzQ0NTMzZmYwYjEzZmU0MGEsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpVM01ETXdOVEU0TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2lkMlZpSWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpOQ0lzSW5OamIzQmxJanBiSW5ZM0lpd2lkamdpTENKMk9TSXNJbll4TUNJc0luWXhNU0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklpd2lZMnhwWlc1MElpd2ljMlZ5ZG1WeUlpd2ljMmhoY0dWeklpd2labTl5YldGMElsMHNJbVJsYlc4aU9uUnlkV1Y5');

// Set the extensions
jspreadsheet.setExtensions({ formula });

// Create a new spreadsheet
jspreadsheet(document.getElementById('spreadsheet'), {
  worksheets: [{
    data: [
    [
        "Complex Number",
        "Cotangent"
    ],
    [
        "3+4i",
        "=IMCOT(A2)"
    ],
    [
        "1",
        "=IMCOT(A3)"
    ],
    [
        "0+1i",
        "=IMCOT(A4)"
    ],
    [
        "-2+3i",
        "=IMCOT(A5)"
    ]
]
  }]
});
</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('M2M5N2RhZmYxMjMwY2Y4NDliNTBjNTk3YWRlYTJiMTJhN2FiYWYzODRkM2ZiOGYwOTU4N2NhNDBkZGM1NzlkZTI0ZGYxMTM4ODdhYjY2YWFhYjhhNjhiODAyZDQzMWNlYjAyZmVkZmQ4ZjM3MTA3NzQ0NTMzZmYwYjEzZmU0MGEsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpVM01ETXdOVEU0TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2lkMlZpSWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpOQ0lzSW5OamIzQmxJanBiSW5ZM0lpd2lkamdpTENKMk9TSXNJbll4TUNJc0luWXhNU0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklpd2lZMnhwWlc1MElpd2ljMlZ5ZG1WeUlpd2ljMmhoY0dWeklpd2labTl5YldGMElsMHNJbVJsYlc4aU9uUnlkV1Y5');

// Set the extensions
jspreadsheet.setExtensions({ formula });

export default function App() {
    // Spreadsheet array of worksheets
    const spreadsheet = useRef();

    // Worksheet data
    const data = [
    [
        "Complex Number",
        "Cotangent"
    ],
    [
        "3+4i",
        "=IMCOT(A2)"
    ],
    [
        "1",
        "=IMCOT(A3)"
    ],
    [
        "0+1i",
        "=IMCOT(A4)"
    ],
    [
        "-2+3i",
        "=IMCOT(A5)"
    ]
];

    // 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('M2M5N2RhZmYxMjMwY2Y4NDliNTBjNTk3YWRlYTJiMTJhN2FiYWYzODRkM2ZiOGYwOTU4N2NhNDBkZGM1NzlkZTI0ZGYxMTM4ODdhYjY2YWFhYjhhNjhiODAyZDQzMWNlYjAyZmVkZmQ4ZjM3MTA3NzQ0NTMzZmYwYjEzZmU0MGEsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpVM01ETXdOVEU0TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2lkMlZpSWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpOQ0lzSW5OamIzQmxJanBiSW5ZM0lpd2lkamdpTENKMk9TSXNJbll4TUNJc0luWXhNU0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklpd2lZMnhwWlc1MElpd2ljMlZ5ZG1WeUlpd2ljMmhoY0dWeklpd2labTl5YldGMElsMHNJbVJsYlc4aU9uUnlkV1Y5');

// Set the extensions
jspreadsheet.setExtensions({ formula });

export default {
    components: {
        Spreadsheet,
        Worksheet,
    },
    data() {
        // Worksheet data
        const data = [
    [
        "Complex Number",
        "Cotangent"
    ],
    [
        "3+4i",
        "=IMCOT(A2)"
    ],
    [
        "1",
        "=IMCOT(A3)"
    ],
    [
        "0+1i",
        "=IMCOT(A4)"
    ],
    [
        "-2+3i",
        "=IMCOT(A5)"
    ]
]

        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('M2M5N2RhZmYxMjMwY2Y4NDliNTBjNTk3YWRlYTJiMTJhN2FiYWYzODRkM2ZiOGYwOTU4N2NhNDBkZGM1NzlkZTI0ZGYxMTM4ODdhYjY2YWFhYjhhNjhiODAyZDQzMWNlYjAyZmVkZmQ4ZjM3MTA3NzQ0NTMzZmYwYjEzZmU0MGEsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpVM01ETXdOVEU0TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2lkMlZpSWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpOQ0lzSW5OamIzQmxJanBiSW5ZM0lpd2lkamdpTENKMk9TSXNJbll4TUNJc0luWXhNU0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklpd2lZMnhwWlc1MElpd2ljMlZ5ZG1WeUlpd2ljMmhoY0dWeklpd2labTl5YldGMElsMHNJbVJsYlc4aU9uUnlkV1Y5');

// 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: [
    [
        "Complex Number",
        "Cotangent"
    ],
    [
        "3+4i",
        "=IMCOT(A2)"
    ],
    [
        "1",
        "=IMCOT(A3)"
    ],
    [
        "0+1i",
        "=IMCOT(A4)"
    ],
    [
        "-2+3i",
        "=IMCOT(A5)"
    ]
]
            }]
        });
    }
}