ComfyUI Node: cos

Class Name

Basic data handling: MathCos

Category
Basic/maths
Author
StableLlama (Account age: 861days)
Extension
Basic data handling
Latest Updated
2026-05-07
Github Stars
0.04K

How to Install Basic data handling

Install this extension via the ComfyUI Manager by searching for Basic data handling
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Basic data handling in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

cos Description

Calculates cosine of an angle for applications in rotations, waves, and geometric transformations.

cos:

The MathCos node is designed to calculate the cosine of a given angle, which is a fundamental trigonometric function. This node is particularly useful in various mathematical and graphical applications where understanding the relationship between angles and their cosine values is essential. The cosine of an angle is defined as the ratio of the length of the adjacent side to the hypotenuse in a right-angled triangle. By providing the angle in either radians or degrees, this node simplifies the process of obtaining the cosine value, making it accessible for users who may not have a deep mathematical background. This functionality is crucial for tasks that involve rotations, wave calculations, and other geometric transformations, offering a straightforward method to derive cosine values without manual calculations.

cos Input Parameters:

angle

The angle parameter represents the angle for which you want to calculate the cosine. It can be provided as a number or a string that can be converted to a number. The angle can be specified in either radians or degrees, depending on the unit parameter. The default value is 0.0, which corresponds to an angle of zero degrees or radians. This parameter is crucial as it directly influences the cosine value returned by the node.

unit

The unit parameter specifies the unit of measurement for the angle, allowing you to choose between "radians" and "degrees". The default setting is "degrees", which is often more intuitive for users familiar with everyday angle measurements. This parameter ensures that the angle is interpreted correctly, as the cosine function behaves differently depending on whether the angle is in radians or degrees.

cos Output Parameters:

float

The output is a single floating-point number representing the cosine of the specified angle. This value is crucial for understanding the relationship between the angle and its cosine, which can be used in various applications such as graphics rendering, physics simulations, and more. The cosine value ranges from -1 to 1, providing insight into the angle's position on the unit circle.

cos Usage Tips:

  • Ensure that the angle parameter is correctly formatted as a number or a string that can be converted to a number to avoid errors in calculation.
  • Use the unit parameter to specify whether your angle is in degrees or radians, as this will affect the cosine value. Remember that 180 degrees is equivalent to π radians.

cos Common Errors and Solutions:

ValueError: could not convert string to float

  • Explanation: This error occurs when the angle parameter is provided as a string that cannot be converted to a float.
  • Solution: Ensure that the angle is a valid number or a string that represents a number, such as "45" or "3.14".

Invalid unit type

  • Explanation: This error arises if the unit parameter is set to a value other than "radians" or "degrees".
  • Solution: Verify that the unit parameter is correctly set to either "radians" or "degrees" to ensure proper calculation.

cos Related Nodes

Go back to the extension to check out more related nodes.
Basic data handling
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

cos