有人可以帮我用java翻译这行代码吗?
Can someone help me to translate this line of code in java?
if (area >= 30 &&
std::abs(1 - ((double)rect.width / (double)rect.height)) <= 0.2 &&
std::abs(1 - (area / (CV_PI * std::pow(radius, 2)))) <= 0.2)
我想翻译的是std::abs
和CV_PI * std::pow
。
我在网上搜索了std::abs
等效于java,但没有找到任何内容。请帮忙。无法搜索CV_PI * std::pow
,因为我仍然找不到std::abs
。
看看Math
类。
https://docs.oracle.com/javase/7/docs/api/java/lang/Math.html
Math.PI
Math.pow(...)
Math.abs(...)
etc.
相关文章:
- 需要将一行代码从C++ Qt翻译成PyQt
- 如何翻译这个给定代码中的 ::* 运算符和member_fn?
- 是否可以动态翻译QT应用程序而无需复制代码
- C++如何用类和函数将我的代码翻译成OOP
- 将g++代码翻译到clion环境中
- 将C++代码翻译成Python的正确方法
- 注释会被翻译成机器代码吗?C++
- C 结构中的分段错误。使用 Matlab Coder 从 Matlab->C 翻译的代码
- 这段代码到OpenCV Java的翻译是什么?
- 有没有工具可以只翻译代码中的注释
- pyqt QTableView printing(4行C ++代码翻译成python)
- C++ 代码翻译成 Java
- 将Java代码翻译成C++
- C++习语,用于在任意翻译单元中的main之前执行任意代码
- QML是在编译时被翻译成本机代码,还是在运行时被解释为JavaScript在web浏览器中的运行方式
- 有人可以帮我用java翻译这行代码吗?
- 将带有矢量的 cpp 代码翻译成<string>安卓
- 如何在托管代码中正确翻译WH_MOUSE参数
- 手工翻译代码的技巧
- 翻译C++代码片段