当前位置:网站首页>力扣1037. 有效的回旋镖
力扣1037. 有效的回旋镖
2022-07-06 17:22:00 【秀强】
题目
给定一个数组 points ,其中 points[i] = [xi, yi] 表示 X-Y 平面上的一个点,如果这些点构成一个 回旋镖 则返回 true 。
回旋镖 定义为一组三个点,这些点 各不相同 且 不在一条直线上 。
来源:力扣(LeetCode)
链接:https://leetcode.cn/problems/valid-boomerang
向量叉乘
代码
class Solution {
public boolean isBoomerang(int[][] points) {
// 向量叉乘
return (points[0][0] - points[1][0]) * (points[1][1] - points[2][1]) - (points[0][1] - points[1][1]) * (points[1][0] - points[2][0]) != 0;
}
}
边栏推荐
- 学习光线跟踪一样的自3D表征Ego3RT
- What is time
- 深度学习简史(一)
- [牛客] B-完全平方数
- 第四篇,STM32中断控制编程
- Part 7: STM32 serial communication programming
- paddlehub应用出现paddle包报错的问题
- New feature of Oracle 19C: automatic DML redirection of ADG, enhanced read-write separation -- ADG_ REDIRECT_ DML
- Learn to use code to generate beautiful interface documents!!!
- Activereportsjs 3.1 Chinese version | | | activereportsjs 3.1 English version
猜你喜欢
[HFCTF2020]BabyUpload session解析引擎
Trace tool for MySQL further implementation plan
Equals() and hashcode()
View remote test data and records anytime, anywhere -- ipehub2 and ipemotion app
动态规划思想《从入门到放弃》
Part VI, STM32 pulse width modulation (PWM) programming
做微服务研发工程师的一年来的总结
ESP Arduino (IV) PWM waveform control output
Batch obtain the latitude coordinates of all administrative regions in China (to the county level)
Summary of being a microservice R & D Engineer in the past year
随机推荐
Stm32f407 ------- SPI communication
Attention SLAM:一種從人類注意中學習的視覺單目SLAM
OSPF configuration command of Huawei equipment
Data processing of deep learning
ZABBIX 5.0: automatically monitor Alibaba cloud RDS through LLD
ActiveReportsJS 3.1中文版|||ActiveReportsJS 3.1英文版
Installation of torch and torch vision in pytorch
Summary of being a microservice R & D Engineer in the past year
Rainstorm effect in levels - ue5
[yolov5 6.0 | 6.1 deploy tensorrt to torch serve] environment construction | model transformation | engine model deployment (detailed packet file writing method)
Leetcode (547) - number of provinces
Eventbus source code analysis
《安富莱嵌入式周报》第272期:2022.06.27--2022.07.03
Dynamic planning idea "from getting started to giving up"
深度学习之环境配置 jupyter notebook
C9 colleges and universities, doctoral students make a statement of nature!
.class文件的字节码结构
A brief history of deep learning (I)
[batch dos-cmd command - summary and summary] - string search, search, and filter commands (find, findstr), and the difference and discrimination between find and findstr
BFS realizes breadth first traversal of adjacency matrix (with examples)