I'll assume, as I usually do, that this question refers to an object in orbit around the sun.
G = the gravitational constant = G = 6.67384e-11 m³ kg⁻¹ sec⁻²
M = the combined mass of the sun and of the orbiting body, kilograms.*
a = the semimajor axis of the elliptical orbit, meters.
e = the eccentricity of the elliptical orbit
*The mass of the sun is 1.98855e30 kilograms.
Define a constant, k, which is a speed in meters per second.
k = √{ GM / [ a (1 − e²) ] }
The instantaneous velocity vector of the orbiting body, MKS units, referred to the canonical coordinate system (sun at origin, orbit in the XY plane, the orbiting body's perihelion on +x axis) is [Vx''', Vy''', Vz'''].
Vx''' = −k sin θ
Vy''' = k (e + cos θ)
Vz''' = 0
And the speed in the orbit is simply
v = √[(Vx''')² + (Vy''')² + (Vz''')²]
Which can be checked with the Vis Viva equation:
r = a (1−e²) / (1 + e cos θ)
v = √[GM(2/r−1/a)]
For the same instant of time, the position of the object in rectangular canonical coordinates is found from
x = r cos θ
y = r sin θ
z = 0
Where the angle θ is the true anomaly of the orbiting body at that moment. The true anomaly is the angle, subtended at the sun, from a ray extending toward the perihelion of the orbit and to another ray extending toward the current position of the body in that orbit. It is measured in the plane of the orbit in the angular direction of motion.
As time passes, θ increases. In a circular orbit (e=0), θ would increase at a constant rate, whereas the separation between the sun and the orbiting body would not change. However, in an elliptical orbit (0<e<1), θ increases at a variable rate, faster when the orbiting body is near perihelion and slower when it is near aphelion. Furthermore, the separation between the primary and the orbiting body is likewise variable, though inversely to the speed in the orbit.
The constant thing is the angular momentum per unit mass. That's what causes a line from the sun to the orbiting body to sweep out equal areas in equal times.
If you want to transform the canonical velocity to velocity in heliocentric ecliptic coordinates, do this:
Rotate the triple-prime velocity vector by the argument of the perihelion, ω.
Vx'' = Vx''' cos ω − Vy''' sin ω
Vy'' = Vx''' sin ω + Vy''' cos ω
Vz'' = Vz''' = 0
Rotate the double-prime velocity vector by the inclination, i.
Vx' = Vx''
Vy' = Vy'' cos i
Vz' = Vy'' sin i
Rotate the single-prime velocity vector by the longitude of the ascending node, Ω.
Vx = Vx' cos Ω − Vy' sin Ω
Vy = Vx' sin Ω + Vy' cos Ω
Vz = Vz'
The unprimed velocity vector [Vx,Vy,Vz] is the sun-relative velocity in ecliptic coordinates.
The average speed in the orbit is found by dividing the circumference of the orbit by the orbital period. The period, P, of an orbit is found from
P = 2π √[a³/(GM)]
The circumference, C, of an elliptical orbit is found by solving, numerically, this elliptical integral of the 2nd kind:
C = 4a ∫(0,π/2) √(1−e²sin²θ) dθ
Making the average speed in orbit
vₐ = (2/π) √(GM/a) ∫(0,π/2) √(1−e²sin²θ) dθ
Note that this is NOT the same as the speed in the orbit when r=a, except when the orbit is circular (e=0). A lot of astronomy professors don't seem to know this!
v(r=a) = √(GM/a)
vₐ = √(GM/a) (2/π) ∫(0,π/2) √(1−e²sin²θ) dθ
vₐ ≠ v(r=a), in general, though it's usually close.