当前位置:网站首页>力扣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;
}
}
边栏推荐
- Dell Notebook Periodic Flash Screen Fault
- Part V: STM32 system timer and general timer programming
- Explain in detail the matrix normalization function normalize() of OpenCV [norm or value range of the scoped matrix (normalization)], and attach norm_ Example code in the case of minmax
- [HFCTF2020]BabyUpload session解析引擎
- Data type of pytorch tensor
- 再聊聊我常用的15个数据源网站
- 在jupyter中实现实时协同是一种什么体验
- UI控件Telerik UI for WinForms新主题——VS2022启发式主题
- windows安装mysql8(5分钟)
- Service asynchronous communication
猜你喜欢

Attention SLAM:一种从人类注意中学习的视觉单目SLAM

详解OpenCV的矩阵规范化函数normalize()【范围化矩阵的范数或值范围(归一化处理)】,并附NORM_MINMAX情况下的示例代码

【批處理DOS-CMD命令-匯總和小結】-字符串搜索、查找、篩選命令(find、findstr),Find和findstr的區別和辨析

Distributed cache

Installation and testing of pyflink

线段树(SegmentTree)

Stm32f407 ------- DAC digital to analog conversion
![[hfctf2020]babyupload session parsing engine](/img/db/6003129bc16f943ad9868561a2d5dc.png)
[hfctf2020]babyupload session parsing engine

Build your own website (17)

Return to blowing marshland -- travel notes of zhailidong, founder of duanzhitang
随机推荐
Batch obtain the latitude coordinates of all administrative regions in China (to the county level)
《安富莱嵌入式周报》第272期:2022.06.27--2022.07.03
Dell筆記本周期性閃屏故障
[batch dos-cmd command - summary and summary] - jump, cycle, condition commands (goto, errorlevel, if, for [read, segment, extract string]), CMD command error summary, CMD error
Return to blowing marshland -- travel notes of zhailidong, founder of duanzhitang
【JokerのZYNQ7020】AXI_ EMC。
Rainstorm effect in levels - ue5
Informatics Olympiad YBT 1171: factors of large integers | 1.6 13: factors of large integers
A brief history of deep learning (I)
什么是时间
Interface (interface related meaning, different abstract classes, interface callback)
代码克隆的优缺点
资产安全问题或制约加密行业发展 风控+合规成为平台破局关键
5种不同的代码相似性检测,以及代码相似性检测的发展趋势
Stm32f407 ------- DAC digital to analog conversion
Deep understanding of distributed cache design
再聊聊我常用的15个数据源网站
How to get started and improve test development?
SuperSocket 1.6 创建一个简易的报文长度在头部的Socket服务器
建立自己的网站(17)