1

as title: Is it possible to calculate linear interpolation between two known points with accelerate framework in swift

example: a line -> p1(x:0.0, y:0.0) p2(x:100, y:100)
horizon vector = 0 to 100
vertical vector = 0 to 100
when I input X = 50 then output Y= 50

CocoaUser
  • 1,361
  • 1
  • 15
  • 30
  • 1
    Although I'm unfamiliar with what are you trying to achieve, but don't you think that you could make it -by applying an equation- by your self? – Ahmad F Nov 05 '17 at 07:00
  • Have a look at https://stackoverflow.com/questions/32801059/linear-resampling-datapoints-captured-at-fluctuating-time-intervals-to-flxed-ti. – Martin R Nov 05 '17 at 08:58
  • @MartinR. I read this thread, But I don't have any ideas to put horizon vector and vertical vector for calculating. – CocoaUser Nov 06 '17 at 06:38

1 Answers1

1

There's a mix function in simd:

public func mix(_ x: float2, _ y: float2, t: Float) -> float2
Flex Monkey
  • 3,583
  • 17
  • 19