我如何找到一条线的反正切? [英] How do I find the inverse tangent of a line?

查看:129
本文介绍了我如何找到一条线的反正切?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一条线(x1,y1)和(x2,y2)。我想使用tan inverse来查找该行的角度,我将如何在java中执行此操作?

I've got a line (x1,y1) and (x2,y2). I'd like to use tan inverse to find the angle of that line, how would I do so in java?

我想查看该行的角度关于x1,y1

I'd like to see what angle the line makes in relation to x1,y1

推荐答案

您需要

You need


Math.toDegrees(Math.atan((y2-y1)/(x2-x1)))

Math.toDegrees(Math.atan((y2-y1)/(x2-x1)))

当x1 = x2时注意异常。

Do notice exception when x1=x2.

这篇关于我如何找到一条线的反正切?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆