# Lerp in a Object Class

**URL:** <https://discourse.processing.org/t/lerp-in-a-object-class/34491>\
**Category:** Beginners\
**Created:** [January 6, 2022, 6:27pm UTC](https://discourse.processing.org/t/lerp-in-a-object-class/34491 "2022-01-06T18:27:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Noxus010](https://avatars.discourse-cdn.com/v4/letter/n/b487fb/32.png) [@Noxus010](https://discourse.processing.org/u/Noxus010)\
**Post date:** [January 6, 2022, 6:27pm UTC](https://discourse.processing.org/t/lerp-in-a-object-class/34491/1 "2022-01-06T18:27:10Z")

</div>

Hi people! I just started with processing and I would like to have a class that is loaded before I start the draw function… In this class I wanted to use the lerp function but I get a error “lerp function does not exist”…

```auto
   PVector quadratic(PVector p1,PVector p2, PVector p3,float t){  
     var x1 = lerp(p1.x,p2.x,t);
     var y1 = lerp(p1.y,p2.y,t);
     var z1 = lerp(p1.z,p2.z,t);
     var x2 = lerp(p2.x,p3.x,t);
     var y2 = lerp(p2.y,p3.y,t);
     var z2 = lerp(p2.z,p3.z,t);
     float x = lerp(x1,x2,t);
     float y = lerp(y1,y2,t);
     float z = lerp(z1,z2,t);
  return new PVector(x,y,z);
      }

```

this is inside my class after the constructor… any help is appreciated 😃 thanks
