ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Converting inputs from degrees to radians for Trigonometric tools

Available with Spatial Analyst license.

To use degrees as inputs for trigonometric tools, the values need to be converted into radians. To do the conversion, multiply the input values by pi/180, or approximately 0.01745.

In Python, this conversion can be done directly in the expression, or you can define a variable to store the value once and reuse it as needed. Using the Cos tool as an example, the syntax could be in the following form:

>>> import math
>>> from arcpy.sa import *
>>> OutRas = Cos (InRas * math.pi / 180.0)
Or, you can use a variable for the conversion factor:
>>> import math
>>> deg2rad = math.pi / 180.0
>>> from arcpy.sa import *
>>> OutRas = Cos (InRas * deg2rad)

The following illustrations demonstrate converting inputs whose values are in degrees into radians before performing the particular operation.

Note:

The variable defined in the example above will be used in these examples.

Examples of converting trigonometric inputs to radians

Tool

Illustration and Python syntax

Cos
Cos illustration with input converted from Degrees to Radians
OutRas = Cos(InRas * deg2rad)
Sin
Sin illustration with input converted from Degrees to Radians
OutRas = Sin(InRas * deg2rad)
Tan
Tan illustration with input converted from Degrees to Radians
OutRas = Tan(InRas * deg2rad)

Related Topics

  • An overview of the Trigonometric Math toolset
  • Cos
  • Sin
  • Tan
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal