Confused by deltaX and deltaY
See original GitHub issueDocumentation:
{
event, // source event
deltaX, // x offset (current.x - initial.x)
deltaY, // y offset (current.y - initial.y)
absX, // absolute deltaX
absY, // absolute deltaY
velocity, // √(absX^2 + absY^2) / time
dir, // direction of swipe (Left|Right|Up|Down)
}
Codebase:
const { clientX, clientY } = event.touches ? event.touches[0] : event
const [x, y] = rotateXYByAngle([clientX, clientY], props.rotationAngle)
const deltaX = state.xy[0] - x
const deltaY = state.xy[1] - y
My question here is, are clientX
and clientY
the current x and y coordinates of the mouse?
The docs says current.x minus initial.x, I was expecting that a mouse movement from left to right returns a positive value, but it’s the opposite.
Am I getting something wrong here?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Delta x / Delta y: Definition, Examples - Statistics How To
Delta y / delta y means "small changes", either on the x-axis or y-axis. It's not to be confused with the derivative, dy/dx....
Read more >What is the difference between dy, del y and delta y? - Quora
Delta indicates “a small change” - so delta x means “a small change in x”. For slopes of lines, we take 2 points...
Read more >The difference between $\Delta x$, $\delta x$ and $dx
dx is used to denote the derivative when you have a univariate function (when you just have x and there is no confusion)....
Read more >Given y=f(x)=x^3-9x+5 find dy and delta y with x=1 ... - YouTube
Given y=f(x)=x^3-9x+5 find dy and delta y with x=1 and delta x =0.1. Watch later. Share. Copy link. Info. Shopping. Tap to unmute....
Read more >[java] how to find the deltax and deltay to move a ball ... - Reddit
I know I'm supposed to use Math.toRadians(angle), Math.sin(theta) and Math.cos(theta), but using all of this to find the deltax and deltay is confusing...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@r-inaldi Thank you for posting the issue, you’ve absolutely found a discrepancy. The readme should say
initial - current
, I’ll get a small PR to update the docs. At least it looks like we’ve been consistent between v4 & v5.I think you’re absolutely correct and we should be doing
current - initial
and I think that’s why the docs say that, but it looks like we just “copied” what we had in v4 to v5 in the code.Going to make a note to make this change for
v6
when we drop the<Swipeable />
component.@psikoi thanks for the :poke:, i was keeping it open till i merged and deployed #162