当前位置:网站首页>Check if point is inside rectangle
Check if point is inside rectangle
2022-08-01 23:07:00 【Ziwei front end】
JavaScript version
const isInside = (point, rect) => point.x > rect.left && point.x < rect.right && point.y > rect.top && point.y < rect.bottom;
TypeScript version
interface Point {
x: number;
y: number;
}
interface Rect {
bottom: number;
left: number;
top: number;
right: number;
}
const isInside = (point: Point, rect: Rect): boolean => point.x > rect.left && point.x < rect.right && point.y > rect.top && point.y < rect.bottom;
边栏推荐
- 【C补充】链表专题 - 单向链表
- 华为无线设备配置全局双链路冷备份(AC全局配置方式)
- excel change cell size
- 【参营经历贴】2022网安夏令营
- visual studio code multiple editing
- 计算两点之间的中点
- SQL29 Calculate the average next day retention rate of users
- Go 微服务开发框架DMicro的设计思路
- 系统可用性:SRE口中的3个9,4个9...到底是个什么东西?
- Wechat Gymnasium Reservation Mini Program Graduation Design Finished Work Mini Program Graduation Design Finished Product (2) Mini Program Function
猜你喜欢
Go 微服务开发框架DMicro的设计思路
从0到100:招生报名小程序开发笔记
xctf attack and defense world web master advanced area web2
文件查询匹配神器 【glob.js】 实用教程
Use Jenkins for continuous integration, this knowledge point must be mastered
【参营经历贴】2022网安夏令营
PDF转Word有那么难吗?做一个文件转换器,都解决了
2022年最新河北建筑八大员(机械员)模拟考试题库及答案
毫秒级!千万人脸库快速比对,上亿商品图片检索,背后的极速检索用了什么神器?
img 响应式图片的实现(含srcset属性、sizes属性的使用方法,设备像素比详解)
随机推荐
PHP算法之有效的括号
华为无线设备配置全局双链路冷备份(AC全局配置方式)
CF1705D Mark and Lightbulbs
【参营经历贴】2022网安夏令营
APP special test: traffic test
TCP 可靠吗?为什么?
PAM Palindromic Automata
excel split text into different rows
选择合适的 DevOps 工具,从理解 DevOps 开始
最短路模板
JS 数组去重(含简单数组去重、对象数组去重)
测试岗月薪5-9k,如何实现涨薪到25k?
cmd指令
解决端口占用
xctf attack and defense world web master advanced area web2
y84.第四章 Prometheus大厂监控体系及实战 -- prometheus告警机制进阶(十五)
excel vertical to horizontal
请问什么是 CICD
Deep learning Course2 first week Practical aspects of Deep Learning exercises
Oracle 数据库设置为只读及读写