ComfyUI  >  Nodes  >  Derfuu_ComfyUI_ModdedNodes >  Cosines

ComfyUI Node: Cosines

Class Name

DF_Cosines

Category
Derfuu_Nodes/Math/Trigonometry
Author
Derfuu (Account age: 1829 days)
Extension
Derfuu_ComfyUI_ModdedNodes
Latest Updated
6/22/2024
Github Stars
0.3K

How to Install Derfuu_ComfyUI_ModdedNodes

Install this extension via the ComfyUI Manager by searching for  Derfuu_ComfyUI_ModdedNodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Derfuu_ComfyUI_ModdedNodes 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Cosines Description

Compute cosine of angles in radians/degrees, including arccosine for inverse calculations, aiding AI artists in trigonometric workflows.

Cosines:

The DF_Cosines node is designed to compute the cosine of a given angle, providing a versatile tool for AI artists who need to incorporate trigonometric calculations into their workflows. This node can handle both radians and degrees, making it adaptable to various input formats. Additionally, it offers the capability to compute the arccosine, which is the inverse cosine function, allowing you to determine the angle from a given cosine value. This flexibility makes the DF_Cosines node a powerful addition to your toolkit, enabling precise control over trigonometric operations in your creative projects.

Cosines Input Parameters:

value

This parameter represents the angle or cosine value that you want to process. If you are computing the cosine, this should be the angle in either radians or degrees. If you are computing the arccosine, this should be the cosine value. The input should be a floating-point number. The range for angles in degrees is typically between 0 and 360, while in radians, it is between 0 and 2π. For cosine values, the range is between -1 and 1.

type_

This parameter specifies the unit of the input angle. It can be either "RAD" for radians or "DEG" for degrees. This allows the node to correctly interpret the input value and perform the necessary conversion if needed. The available options are "RAD" and "DEG", with "RAD" being the default.

arcCos

This boolean parameter determines whether the node should compute the arccosine (inverse cosine) instead of the cosine. If set to True, the node will compute the arccosine of the input value, which should be a cosine value between -1 and 1. If set to False, the node will compute the cosine of the input angle. The default value is False.

Cosines Output Parameters:

FLOAT

The output of the DF_Cosines node is a single floating-point number. If the node is set to compute the cosine, this will be the cosine of the input angle. If the node is set to compute the arccosine, this will be the angle whose cosine is the input value. The output is always in radians, regardless of the input unit.

Cosines Usage Tips:

  • To compute the cosine of an angle given in degrees, set the type_ parameter to "DEG" to ensure the input is correctly interpreted.
  • Use the arcCos parameter to switch between computing the cosine and the arccosine, depending on your needs.
  • When working with angles in degrees, remember that the output will always be in radians, so you may need to convert it if you require the result in degrees.

Cosines Common Errors and Solutions:

"ValueError: math domain error"

  • Explanation: This error occurs when the input value for the arccosine function is outside the valid range of -1 to 1. - Solution: Ensure that the input value for the arccosine computation is within the range of -1 to 1.

"TypeError: a float is required"

  • Explanation: This error occurs when the input value is not a floating-point number.
  • Solution: Make sure that the input value is a valid floating-point number.

"Invalid type_ parameter"

  • Explanation: This error occurs when the type_ parameter is set to a value other than "RAD" or "DEG".
  • Solution: Ensure that the type_ parameter is set to either "RAD" or "DEG".

Cosines Related Nodes

Go back to the extension to check out more related nodes.
Derfuu_ComfyUI_ModdedNodes
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.